Magic may be defined as making people believe that they have seen/felt/experienced something that didn’t really happen. One might say the same about religion. Stage magicians mess with your sense of reality to entertain and hopefully to make a living. Preachers do the same. A major difference is that the vast majority of magicians will openly admit that they are performing tricks.
In any case, the study of how magicians fool us can teach us something about how the human brain works, and in so doing it may teach us something about how religion fools us too.
What Can Magicians Teach Us about the Brain? Scientific American