Many fantasy worlds draw heavily on real world history, geography and sociology, and also on folklore.
Even when the land itself is not in danger, it is often used symbolically, for thematic purposes, and to underscore moods.
An early example of the fantasy land/world concept can be seen in the One Thousand and One Nights (Arabian Nights), where places of which little was known and where marvels were plausible had to be set further "long ago" or farther "far away"; this is a process that continues, and finally culminates in the fantasy world having little connection, if any, to actual times and places.
Dream frames were also once common for encasing the fantasy world with an explanation of its marvels. Such a dream frame was added to the story of The Wonderful Wizard of Oz for the movie version; in the book, Oz is clearly defined as an actual place. These dream-settings have been criticized, and are far less frequent today.
This change is part of a general trend toward more self-consistent and substantive fantasy worlds. This has also altered the nature of the plots; earlier works often feature a solitary individual whose adventures in the fantasy world are of personal significiance, and where the world clearly exists to give scope to these adventures, and later works more often feature characters in a social web, where their actions are to save the world and those in it from peril.
Careful attention to world-building and meticulous detail in it is often cited as the reason why certain fantasy works are deeply convincing and contain a magical sense of place.
Heavy and faithful use of real world setting for inspiration, as in Barry Hughart's Bridge of Birds, clearly derived from China, or Lloyd Alexander's use of real world cultures such as Welsh for The Chronicles of Prydain or Indian for The Iron Ring, make the line between fantasy worlds and alternate histories fuzzy. The use of cultural elements, and still more history and geography, from actual settings pushes a work toward alternate history.
Conversely, the introduction of an imaginary country -- such as Ruritania or Graustark -- does not transform a world into a fantasy world, even if the location would be impossible owing to the lack of land to contain it, but such Ruritanian romances may be pushed toward fantasy worlds by the ambiguity of witches and wise women, where it is not clear whether their magic is effectual.
According to Lin Carter in Imaginary Worlds: the Art of Fantasy, fantasy worlds, by their nature, contain some element of magic (paranormal). This element may be the creatures in it -- dragons, unicorns, genies -- or the magical abilities of the people in the world. These are often drawn from mythology and folklore, frequently that of the historical country also used for inspiration.
Fantasy worlds created through a process world building are known as a constructed world. Constructed worlds elaborate and make self-consistent the setting of a fantasy work. World building relies on materials and concepts taken from the real world.
Despite the use of magic or other fantastic elements such as dragons, the world is normally presented as one that would function normally, one in which people could actually live, making economic, historical, and ecological sense. It is considered a flaw to have, for example, pirates living in lands far from trade routes, or to assign prices for a night's stay in an inn that would equate to several years' income for a farmer. Furthermore, the fantastic elements should ideally operate according to self-consistent rules of their own; for example, if wizards' spells sap their strength, a wizard who does not appear to suffer this must either be putting up a facade, or have an alternative explanation. This distinguishes fantasy worlds from surrealism and even from such dream worlds such as are found in Alice's Adventures in Wonderland and Through the Looking-Glass.
J. R. R. Tolkien created Middle-earth, probably the best-known fantasy world today. He introduced several revolutionary concepts to fantasy fiction populariazed the idea of intricately detailed fantasy worlds. He wrote at some length about the process, which he called "sub-creation".
C. S. Lewis, author of the Chronicles of Narnia which takes place in a magical land called Narnia. A colleague of Tolkien, their fiction worlds share several key elements.
Fairytale fantasy may ignore the normal world-building in order to present a world operating by the same logic as the fairytales from which they are derived, though other works in this subgenre develop their worlds fully. Comic fantasy may ignore all possible logic in search of humor, particularly if it is parodying other fantasies' faulty world-building, as in Diana Wynne Jones's Dark Lord of Derkholm, or the illogic of the setting is integral to the comedy, as in L. Sprague de Camp's Solomon's Stone, where the fantasy world is populated by the heroic and glamorous figures that people daydream about being, resulting in a severe shortage of workers in the more mundane, day-to-day industries. Most other subgenres of fantasy suffer if the world-building is neglected.
Rather than creating their own fantasy world many authors choose to set their novels in Earth's past. However in doing so the question arises: If these mystic elements were once found on earth where have they gone?
One common answer is to introduce "a retreat of magic" (sometimes called "thinning") that explains why the magic and other fantastic elements no longer appear: For example in The Lord of the Rings, the destruction of the One Ring not only defeated Sauron, but destroyed the power of the Three Rings of the elves, resulting in their sailing into the West at the end of the story.
A contemporary fantasy necessarily takes place in what purports to be the real world, and not a fantasy world. It may, however, include reference to such a retreat. J. K. Rowling's Fantastic Beasts and Where to Find Them explains that wizards eventually decided to conceal all magic creatures and artifacts from non-magic users.
Dungeons & Dragons, the first major role-playing game, has created several detailed and commercially successful fantasy worlds (called "campaign settings"), with established and recognizable characters, locations, histories, and sociologies. The Forgotten Realms is perhaps the most extensively developed of these worlds. These elements of detail can be a large part of what attracts people to RPGs.
Many established fantasy writers have also derided Dungeons and Dragons and the fantasy fiction it has inspired due to its influencing new writers toward reading the Dungeons & Dragons Monster Manual instead of studying the original literature and mythology from which modern fantasy literature has sprung.
Due to the fuzzy boundary between fantasy and science fiction, it is similarly difficult to make a hard-and-fast distinction between "fantasy worlds" and planets in science fiction. For example, the worlds of Barsoom, Darkover, Gor, and the Witch World combine elements of both genres.