Bronislaw Malinowski, the great anthropologist, does exactly the right thing when explaining magic: he looks for the psychological causes that explain why people want magic. In Magic, Science and Religion, 1925:
What does man do naturally under such conditions, setting aside all magic, belief and ritual? Forsaken by his knowledge, baffled by his past experience and by his technical skill, he realizes his impotence. Yet his desire grips him only the more strongly;his anxiety, his fears and hopes, induce a tension in his organism which drives him to some sort of activity. Whether he be savage or civilized, whether in possession of magic or entirely ignorant of its existence; passive inaction, the only thing dictated by reason, is the last thing in which he can acquiesce. His nervous system and his whole organism drive him to some substitute activity. Obsessed by the idea of the desired end, he sees it and feels it. His organism reproduces the acts suggested by the anticipations of hope, dictated by the emotion of passion so strongly felt.
This is what must be done for religion: for the ideas of god, salvation, grace, the afterlife etc. The explanation is so clearly and distinctly true, that we are compelled to believe him that this is the (only) reason we hanker after magical powers. Once we have understood this, we might still experience lingering wishes, but we shall never be able to seriously do magic. We have been, so to speak, exorcised by reason.