Magic in fantasy books generally falls into one of two types:
1. In the first type, magical effects are well-defined and have clear limitations. It is possible for the reader to deduce what can be done by magic and how; main characters often solve problems by creative and surprising (but still consistent with the limitations) use of magic.
This kind of magic is clearly defined either on the level of language (fairytale-style magic) or physics (e.g. in Brandon Sanderson's books).
It is easy to translate magic that works like this to RPG. The only problem is that it's very non-D&D-like. It's narrow, without a multitude of spells for every problem. It's defined by how it works in the fiction, not by mechanical rules. And it's most interesting when "used creatively" which, for most D&D players and gamemasters, translates to "abused".
2. The second type keeps magic much more mysterious and nebulous. It's easier for the author to do and it makes the magic feel "magical". On the other hand, without clear limitations, it's not a good tool for problem solving because it removes the dramatic tension and feels like a handwave.
Because of that, good books with this kind of magic put it in hands of antagonists only or give main characters reasons to use non-magical solutions for important problems instead of casting spells at them (see: Gandalf in LOtR, Rand in WoT).
This kind of magic poorly translates to RPGs. Most of D&D problems with overpowered casters stem from taking magic that can do everything (but isn't used this way, because of author's choice) and giving it to players that don't care for dramatic structure.