Or, putting it another way, we can follow the argument of Sir James Frazier (third chapter of the Golden Bough) that magic is a kind of primitive science, trying to discover the workings of cause-and-effect in order to manipulate the world. Among their discoveries were the principles of imitation and contagion. "Imitation" being the principle that you can make things happen by doing something similar, e.g. pouring water onto the ground to encourage the rain to fall. "Contagion" being the principle that what you do to an item will affect something which it has touched; what you do to a hair might injure the person it came from, what you do to a knife might heal the person it injured. That is how, like the scientist, they were aiming to control the world around them.
This is different from reliigion. Reliigion makes requests from spiritual powers. Magic gives them orders.
This is different from reliigion. Reliigion makes requests from spiritual powers. Magic gives them orders.