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.
The frame story for both Tolkien's novels published in his lifetime, The Hobbit and The Lord of the Rings, is that the eponymous Hobbit Bilbo Baggins wrote a memoir of his adventures, which became The Red Book of Westmarch. This was continued by his relative Frodo Baggins, who carried the One Ring to Mount Doom, and then by Frodo's servant, Samwise Gamgee, who had accompanied him. The Lord of the Rings contains an appendix, "The Tale of Aragorn and Arwen", which, being written by Men rather than Hobbits, has its own frame story.
The legendarium, the body of writing behind the posthumously-published The Silmarillion, has a frame story that evolved over Tolkien's long writing career. It centred on a character, Aelfwine the mariner, whose name, like those of several later reincarnations of the frame-characters, means "Elf-friend". He sails the seas and is shipwrecked on an island where the Elves narrate their tales to him. The legendarium contains two incomplete time-travel novels, The Lost Road and The Notion Club Papers, which are framed by various "Elf-friend" characters who by dream or other means visit earlier ages, step by step all the way back to the ancient, Atlantis-like lost civilisation of Númenor.
Tolkien was influenced by William Morris's use of a frame story in his 1868–1870 epic poem The Earthly Paradise, in which mariners of Norway set sail for the mythical place, where they hear and narrate tales, one of them of a wanderer much like Eärendil. Tolkien was familiar, too, with the Celtic Imram sea-voyage legends such as those of St Brendan, who returned to tell many stories, and published a poem called "Imram" from his legendarium.
Eventually, Tolkien gave the book not just a frame story, but an elaborate editorial frame of prologue and appendices that together imply the survival of a manuscript through the thousands of years since the end of the Third Age, along with the editing and annotation of that manuscript by many hands. This placed Tolkien in the congenial role for a philologist of having to "translate" the ancient languages used in the manuscript.