J. R. R. Tolkien used frame stories throughout his Middle-earth writings, especially his legendarium, to make the works resemble a genuine mythology written and edited by many hands over a long period of time. He described in detail how his fictional characters wrote their books and transmitted them to others, and showed how later in-universe editors annotated the material.
Tolkien was following in a long tradition by framing his stories in another tale explaining how they were told. That tradition includes One Thousand and One Nights, where Scheherazade kept the king entertained with one story after another. Painting by Ferdinand Keller, 1880
Detail of the runes that provide a frame story in Tolkien's 1937 dust jacket painting for The Hobbit. The runes here shown running horizontally read in English "journey made by Bilbo Baggins of Hob[biton]".
The medieval poem Beowulf contains a passage about a scop reciting the tale of the hero Beowulf. Illustration by Joseph Ratcliffe Skelton, c. 1910
The brothers Hengest and Horsa are the legendary founders of England; in The Book of Lost Tales, Tolkien places Ælfwine as their father. Illustration from Edward Parrott's 1909 Pageant of British History
A frame story is a literary technique that serves as a companion piece to a story within a story, where an introductory or main narrative sets the stage either for a more emphasized second narrative or for a set of shorter stories. The frame story leads readers from a first story into one or more other stories within it. The frame story may also be used to inform readers about aspects of the secondary narrative(s) that may otherwise be hard to understand. This should not be confused with narrative structure. A notable example is The Decameron.
One of the earliest frame stories is in the Odyssey, which begins with Odysseus telling stories to King Alcinous on the island of Scheria. Painting of Odysseus at the Court of Alcinous by Francesco Hayez, 1814-1815
One Thousand and One Nights frames many stories with a single narrator, Shahrazad; embedded within it are further framed sets of tales, such as those of Sindbad the Sailor. Illustration Sindbad the sailor and Ali Baba and the forty thieves by William Strang, 1896
The Return of Rip Van Winkle, painting by John Quidor, 1849