The earliest known frame stories are those preserved on the ancient Egyptian Papyrus Westcar. Other early examples are from 1st millennium BC India, when the Sanskrit epics Mahabharata, Ramayana, Vishnu Sarma's Panchatantra, Jain Stories, Syntipas's The Seven Wise Masters, and the fable collections Hitopadesha and Vikram and The Vampire were written. This form gradually spread west through the centuries and became popular, giving rise to such classic frame tale collections as the One Thousand and One Nights (Arabian Nights), The Decameron, and Canterbury Tales. This format had flexibility in that various narrators could retain the stories they liked or understood, while dropping ones they didn't and adding new ones they heard from other places. This occurred particularly with One Thousand and One Nights, where different versions over the centuries have included different stories.
The use of a frame story in which a single narrative is set in the context of the telling of a story is also a technique with a long history, dating back at least to the beginning section of the Odyssey, in which the narrator Odysseus tells of his wandering in the court of King Alcinous.
This literary device acts as a convenient conceit for the organization of a set of smaller narratives, which are either of the devising of the author or taken from a previous stock of popular tales, slightly altered by the author for the purpose of the longer narrative. Sometimes a story within the main narrative can be used to sum up or encapsulate some aspect of the framing story, in which case it is referred to in literary criticism by the French term mise en abyme.
A typical example of a frame story is One Thousand and One Nights, in which the character Shahrazad narrates a set of fairy tales to the Sultan Shahriyar over many nights. Many of Shahrazad's tales are also frame stories, such as Tale of Sindbad the Seaman and Sindbad the Landsman, a collection of adventures related by Sindbad the Seaman to Sindbad the Landsman.
Extensive use of this device is found in Ovid's Metamorphoses, where the stories nest several deep, to allow the inclusion of many different tales in one work. Emily Brontë's Wuthering Heights uses this literary device to tell the story of Heathcliff and Catherine, along with the subplots. Her sister Anne also uses this device in her epistolary novel The Tenant of Wildfell Hall. The main heroine's diary is framed by the narrator's story and letters.