A subsection of letting the story grow the world it needs. Because sometimes it needs a lot of magic. And sometimes it needs magic severely restricted. And sometimes it needs the magic to be as neutral as chemistry, and sometimes always tainted, and sometimes a tool in the great war of good and evil. And sometimes, of course, it needs stuff.
Once had a critique from someone who didn't get and suggested that I throw in a lot more random magic into a story, giving it to random folks to do random things. On the grounds that it only had two wizards, but since it had manticores and basilisks, obviously this was wrong, and it needed more wizards.
Still it can be a surprise, weaving two stories together, and getting a contrast between one who's ransacking a library loaded with magical texts, and even using magic to find her spell quickly, and one who chases through documents by hand and has, over the years, thrice happened on things that might lead to magical effects practical for use -- and even those are hard to pull off.