>>10878052"Magic" probably comes from the Proto-Indo-European reconstruction "magh-" meaning something along the lines of "to be able to."
If a predatory animal has more success catching and killing its prey by taking more care to remain still and quiet before pouncing, then that for example could be a helpful association for it to pick up (quiet and motionless --> reward of food).
This behavior is generalized and not specific to any one particular scenario like the quiet and motionless hunting example. If it were specific and not generalized it would be too limited and inflexible of a trait and the animal subject would not be able to learn how to respond to all the other scenarios of life or death importance it will encounter on a regular basis.
As a consequence of associative behavior acting generally and not case-specifically, *faulty* associations can be (and are) made. B.F. Skinner made famous observations about these faulty associations in his study of pigeons. The pigeon test subjects would repeat arbitrary body movements they happened to have been engaging in when they were fed in the past, effectively behaving as though a coincidence were a cause and their body movements could create another feeding event. The common term for this idea of course is "superstition."
Similarly with our own species, we have a history of people using body movements or performing rituals like sacrificing an animal, behaving as though such actions could create what are in reality not causally connected outcomes such as having a good harvest ("lottery in June, corn be heavy soon") or curing a sick child.
Magic is a collection of faulty associations where the practicing party believes their rituals cause desired outcomes.
Science in contrast is the system of formally testing and documenting apparent associations so we can reliably manipulate natural phenomena for concrete results e.g. the harnessing of electricity and telecommunications networks that allow you to read this.