Philosophers and psychiatrists both use the word “magic" as a term of abuse. Intelligent Design Theory is accused of relying on magic. Psychiatric patients are accused of “Magical Thinking” when they believe that they can get what they want by simply wishing for it. Magical Thinking is often seen as the enemy of reason or science, but I think it would be more accurate to say that what Magical Thinking really rejects is causality. Knowledge and skills are dependent on knowing, and/or having a “grip” on, some causal factor that produces an effect we want. When defenders of Intelligent Design say that God interacts with the world “directly”, and that no further explanation is possible, they are renouncing causality itself. When people try to get what they want by just wishing for it, without bothering to find out how to get what they want, they are also renouncing causality, and putting their faith in magic.
Most people think that magic is just theories that aren’t true. By this definition, Newton would be a magician, because we now know that there is no such thing as absolute space. In fact, Newton also believed in Alchemy, which is often called a branch of magic because it is so different from what scientists believe today. However, none of this detracts from Newton’s credentials as a scientist, which rest not on the content of his beliefs, but on his methods of doing research. The basic ideals of the scientific method rest on principles like causality, the principle of sufficient reason, and the search for abstract unity to account for perceived regular patterns. Anyone in the past, present, or future who rigorously adheres to these kinds of ideals has a right to be called a scientist, even if much of what they “discover” is eventually revealed to be wrong.
In fact, to be completely fair, we should not deny this honorific even to our colleagues in alternative possible realities. That is why, by the definition described above, there is actually no magic in the Harry Potter books. What Harry and his friends are studying at Hogwarts are the causal principles of an alternative reality very different from ours. The intellectual rigor required of a Hogwarts-style magician is essentially the same as that required of a scientist. Or perhaps more accurately, an engineer. The Weasley twins do some original research while developing their joke shop wares, and Dumbledore probably worked in something resembling a laboratory when he discovered the twelve new uses for dragon’s blood. But students in Hogwarts classes learn what was discovered by research outside their classrooms, and like engineers, they learn how to use these skills and facts to produce practical results.
Also like engineers, if Hogwarts students don’t fully learn the intricacies of the causal order, they don’t get the results they strive for. When Hermione Granger tried to transform herself using polyjuice potion, it was not enough to wish to be transformed. She had to get all the ingredients and procedures right, and one mistake (using a cat hair instead of a human hair), turned her into a cat instead of a Slytherin girl. In fact, almost every chapter shows examples of what happens when a student doesn’t fully understand the causal order of this alternative reality. Bones get completely removed instead of healed, teacups grow fur but refuse to turn into hamsters, and naïve people ignore the principles of evidence and believe in “non-existent” creatures like crumpled-horn snorkacks. Ironically, the Harry Potter books could be a child’s best cure for what psychiatrists call Magical Thinking. They might even be good introductory material for a class in scientific method.