Brandon Sanderson's First Law of Magic states that "an author's ability to solve conflict with magic is directly proportional to how well the reader understands said magic". In essence, that means readers will enjoy magic-driven resolutions more if they were done in accordance with rules of the magic system set up throughout the story. These rules can be either loose or constricting, depending upon the story; they should be there one way or the other if the story is to be well-written. Established rules are, generally speaking, not to be tampered with. As Brandon said in his essay on the law "If we simply let ourselves develop new rules every time our characters are in danger, we will end up creating fiction that is not only unfulfilling and unexciting, but just plain bad".
Having loose rules in your fantasy typically makes the magic "soft". Just enough is established about the magic that whatever the conflict is in the story, magic cannot solve it easily. Few situations are worse than bringing an archmage to the final battle where he has every opportunity in the world to kill the bad guy, yet doesn't for no apparent reason. A nice way to play it is to have magic cause conflict. An antagonist with Gandalf-like abilities fighting against everymen is a far better story than its reverse. In that case, you must still make it plausible for the protagonist(s) to survive. "Soft" systems preserve the wonder of fantasy.
"Hard" magic systems tend to have constricting rules. Magic in those stories can only do a set number of things. Mr. Sanderson prefers to write "hard" systems. If a problem arises, you can tell right from the start whether magic will help and how far that assistance will go. In a good story, trying to solve a problem with magic will backfire on occasion and rarely have an overwhelming effect. You still have to make such fails in the try/fail cycle make sense, don't forget. Such systems rely on the other abilities of characters, e.g., their wit and wisdom, to use the magic properly. When Hermione Granger thought to make a polyjuice potion in the second Harry Potter book, she showed intellect that trumped what others had to offer. Such a solution to the problem required as much effort as was needed to keep the resolution satisfying. It even led to unwanted side-effects (as noted previously). It wasn't the only possibility; it just so happens that it was the chosen method of problem-solving. "Softer" systems suffer from magic being so easy to come by that when characters try, they succeed. A decent struggle, if not several tense failures, leads to far better reading. Using magic to create flavor and intricacies to your story is the purpose of "hard" magic.
Brandon considers magic to be just another tool in his characters' tool box. Don't refuse a character magic simply because it's useful. A sword has many valuable uses; its power is limited. Magic can often be used in the same way. If you try to cut a ghoul in half and it doesn't work, using a spell as Plan-B with equal odds of success (at least in the characters' minds) is fine. Keeping the total power of magic in check with the total power of other things in your world allows for a cool, even playing field. Brandon Sanderson's Second Law of Magic follows up on that concept. As long as a fighter in your party and a wizard in your party (although that's quite cliche) are equally powerful, conflicts may be solved by either or both of them. Either system can achieve this equilibrium if done well.
When the climax of a work of fantasy strikes, the effects cascading upon its readers are highly influenced by how well they understood the situation. Was magic a reasonable solution (assuming it was used in one way or another)? Could the resolution have happened sooner or arrived later due to it? Were there other options that had similar chances of success without the use of magic? Readers who feel the characters acted in ways consistent with their characters, using magic in a wondrous, heart-quickening tension-peak will close the book beaming almost guaranteed.