Magic often serves as a plot device and has long been a component of fiction, from the days of Homer and Apuleius down through the tales of the Holy Grail and King Arthur to more contemporary authors.
Historically, witches such as the Weird Sisters in William Shakespeare's Macbeth, wizards such as Prospero in The Tempest or characters like Doctor Faustus in Christopher Marlowe's play of the same name were widely considered to be real.: 1027 Contemporary authors tend to treat magic as an imaginary idea, opting to build their worlds with a blank slate where the laws of reality do not carry as much weight.: 1027
Within a work of fantasy, magic can help to advance the plot, often providing power to heroes or to their opponents. The use of magic frequently manifests itself in a transformation of a character, if not the transformation of the fictional world.: 143
For magic to carry out its functions, it often comes at a price equal to its value.[need quotation to verify]: 143
Fictional magic may or may not include a detailed magic system, but it is not uncommon for authors to omit details or explanations of certain limitations, ostensibly for pacing or other purposes; in these cases, it is possible that magic serves more as a convenience to the author rather than as a device for the character.
In nearly any given fantasy magical system, magical ability is limited. Limitations can add conflict to the story and prevent characters from becoming all-powerful with magic, although characters with unlimited power (such as deities or transcendental beings) are not unheard of in fiction.: 616 Fantasy writers use a variety of techniques to limit the magic in their stories, such as limiting the number of spells a character has or may cast before needing rest, restricting a character's magic to the use of a specific object, limiting magic to the use of certain rare materials, or restricting the magic a character can use through its negative consequences. Some works feature magic that is performed through the use of certain words or incantations to cast spells. While many works use this method without offering an explanation for it, others do offer an explanation.: 134 : 167–168
Authors introduce magic into their stories, and to their characters, in varying ways. Although there is great variation in how spontaneously magic occurs, how difficult it is to wield, and how the guidelines to the magic are implemented, there are a handful of methods for introducing magic found in many fictional works. In many[quantify] fantasy works, writers depict magic as an innate talent, equivalent for example to perfect pitch.: 616 Magic may also be gained through a pact with a devil or with other spirits, a characteristic common in folklore. In some works, such as fairy tales, magic items either endow the main characters with magical powers or have magical powers themselves. Writers often use them as plot devices or MacGuffins to drive the plot of a story.[page needed]