Imagine you are travelling to a foreign country with different laws, customs, traditions and so on. You (the reader) travel in the company of someone who is familiar with that country (the narrator). That companion will warn you of the most deadly pitfalls (such as the death sentence for drug trafficking or that you get your hand hacked off for shop lifting), but beyond that he will give you more details at the time they become relevant, so as not to overwhelm you. So when you go eating at someone's home, your companion and your host will explain to you what they do and what you should do, and everyone will be quite friendly if you don't get it right the first time. But sometimes you will be on your own and you won't understand everything and make mistakes and people will get angry, and only if you get home will your friend explain to you what it was all about and what you should have done.
A good story about a foreign country, that takes the reader by the hand and lets him or her encounter that culture, works much the same way, and a fantasy or science fiction story is basically nothing else but a sort of adventurous travel tale and follows the same basic rules.
In short, give the details of magic as they become relevant. Let the characters discuss them, or the narrator explain them, or simply describe what is done and what happens and let the reader come to their own conclusions. Sometimes the most intriguing books are those that don't explain it all and retain some level of mystery.