Fantasy fiction is a genre of writing in which the plot could not happen in real life (as we know it, at least). Often, the plot involves magic or witchcraft and takes place on another planet or in another — undiscovered — dimension of this world. Most often the overall theme of the setting is medieval in tone, meaning that some combination of the architecture, clothing, language, and technology resembles the European Middle Ages. Many times, the plot also involves mythical creatures or talking animals (that might wear clothes and live in houses), and witches or sorcerers.
Often, writers of fantasy fiction devote a series of books to the same world or characters.
Some of the most famous examples of fantasy fiction are The Chronicles of Narnia, The Lord of the Rings, His Dark Materials (which begins with The Golden Compass), and The Wizard of Earthsea collections. Note that the Harry Potter series also qualifies as fantasy fiction, even though the books take place on contemporary Earth.
Fantasy fiction is frequently confused with science fiction, which might incorporate some of the same tones and themes, but the plot of a science fiction story will also rely on technology that is advanced beyond what we know today. The Star Wars movies are an example: Even though Star Wars is set in the past, takes place in another galaxy, and has mythical creatures as characters, the plot also centers on science (space travel, as well as weaponry and other technology that humankind has yet to invent). Therefore, Star Wars is science fiction rather than fantasy.