The science of magic

I enjoy fantasy for the same reason as everyone else, to be taken out of our world and go on a narrated tour of the fantastical. But magic should still have logical consistency, otherwise it’s impossible for me to get fully immersed in the story.