To make things clear: I don't believe magic exists in our world, I'm just considering it in context of a fictional universe, like MLP. I don't like the "It's magic, you don't have to explain it" approach. If magic is an integral part of a fictional world, then it should be explained like any other part of it. And that's what we will try to do here. We'll start with the sources of magic. What causes it? I think what Starlight says in "All Bottled Up" is a good explanation:
Well, I've always found magic is tied to my emotions. Whatever I'm feeling fuels whatever I'm doing, and the stronger I'm feeling, the stronger the magic.
Of course there are other things that need to be considered here, for example the unicorn horns seem to be a tool that helps focus the magic, and do things like forming it into a laser beam. But the basic idea that magic is fueled by emotions is the most important thing that we need to know. It explains why the magic of friendship and love seem to be the most powerful forms of it, as friendship and love are very strong emotions. Also, sometimes when we see ponies drained of magic in the show, they also seem to be devoid of emotions, at least to some degree.
In the next installment we will talk about the effects of magic. What kind of physical limitations should it be able to overcome? If you have any ideas about that, let me know in the comments. I will share mine in the next entry.