It Must Be Magic
One of the primary reasons why I chose to write science fiction and fantasy is the availability of technology and magic to "shake things up". While I also enjoy reading standard fiction, it usually feels restrained to me because the events in the plot have to be "realistic". Once a writer has successfully created a world for a science fiction or fantasy story, the definition of "realistic" changes. Technology and magic broaden the realm of possibilities. The trick is in staying true to the boundaries of the world you, as a writer, have created. This is why world building is so critical in these genres.
I'm going to focus on magic. While science fiction can stretch the limits of what is scientifically "possible" (in that world), the underlying science still has to have some basis in objective reality. There are a LOT of fans of hard science fiction who will stop reading a book the first time a standard law of physics is violated without a really good explanation as to why that happened. But magic is different. Science and technology actually exist in the real world. Magic doesn't. So when a fantasy writer creates a world containing magic, the writer isn't constrained by the "rules" of the "real world". She invents magic from whole cloth.
Magic is a skill set. Magic is a body of specialized knowledge. But a fantasy world has to have some sort of "magic system" or magic just becomes a "ghost in the machine" that the writer can trot out whenever some plot point needs to be established. A common joke on social media sites that discuss fantasy storytelling - Q. How'd that happen? A. Magic. When a world is constructed, there must be a basis for magic. What is its source? How is it accessed? What are its limitations? The reader must understand these basic ideas so she can form her own opinions about what magic can do and what it can't. Because magic that can do anything at any time for any reason is boring.
Some stories go into tremendous detail when describing magic's ins and outs. The novels based on Dungeons and Dragons are great examples. In that magic system, users of non-divine magic must "memorize" spells from a spell book and use material components in order to tap into what is referred to as "the Weave". The Weave is sort of a plane of mystic energy waiting to be tapped. A wizard of sufficient skill can utilize the energies from the Weave to create an explosive fireball capable of crispy frying anything within the radius of its blast. But the wizard must have that spell memorized AND she must have the necessary material components for the spell. Mary Jane the Magnificent can turn an entire tribe of orcs into fried pork fritters, but only if she happens to have a dollop of bat poop in her belt pouch.
A primary consideration for magic systems is the source of the energy required. The Weave is just a part of existence. In the Kingkiller Chronicles, magic can utilize non-magical energy sources like fires or even body heat. A spell caster can use the energy from her own body if necessary to cast a spell, but doing so leaves her a shivering mess. The Harry Potter books utilize a rather vague system of magic. People are either born with an ability to use magic or they aren't. Spells generally require the use of a wand. The ability to cast spells is gained through academic study - its mostly a matter of knowing the right "magic words". There isn't really a good explanation about where the energy comes from and the limits of any particular magic user aren't well-defined. But since this is the best selling series ever, it demonstrates that the lack of a well-defined system isn't a story killer.
Sometimes magic is restricted by the nature of the power possessed by the character. Gandalf from The Lord of the Rings is a great example. He wasn't just a wizard, he was a Maia. Maiar were agents of the most powerful entities in the realm of Middle Earth. While not quite a god, he was more akin to an angel. So his power was tremendous. Gandalf, however, wasn't a "I'll march in and kill all the baddies" sort of a wizard. Readers of this trilogy often wonder why Gandalf didn't simply march at the front of the Fellowship and demolish anything that got in their way. Gandalf's true power was in leadership and encouragement. He offered wisdom and insight. He provided answers to hard questions. While there were points in the story when he directly engaged the baddies in combat (and I'm talking about the books, not the movies), he did so primarily to drive enemies away or (in the case of the Balrog) to buy time for his fellows to escape. He would not have been able to stand against Sauron, but not simply because Gandalf wasn't powerful enough. Sauron's power was more directed at manipulation and destruction. It was better suited for a direct confrontation than was Gandalf's. But an overriding theme in that trilogy was that wisdom and kindness will ultimately overcome raw destructive power. And in the end, Gandalf won and Sauron lost.