In the poem "The Rime of the Ancient Mariner" by Samuel Taylor Coleridge, the poet uses the past narrative embedded in the present narrative in a literary technique called a framing device, also known as a nested narrative. The frame narrative sets the scene in the story's present, and then once that background is established, one of the characters tells of something that happened in the past. At the end, the author goes back to the story's present, the time in which the story is being told, to wrap things up and consolidate any lessons to be learned.
Framing devices have been used throughout literary history, even as far back as The Odyssey by Homer, in which much of the tale is narrated by Odysseus in aftermath. Joseph Conrad famously used framing devices in his classic works Heart of Darkness and Lord Jim. The movie Titanic uses a framing device in beginning the film with the aged Rose and then telling her story in flashback.
In "The Rime of the Ancient Mariner," a guest at a wedding is accosted by an old sailor, the ancient mariner of the title. As the sailor begins his tale, the wedding guest becomes fascinated and cannot pull away, as Coleridge writes: "He cannot choose but hear." The poet seeks to enthrall us too as readers by luring us into the story as the mariner draws in the wedding guest.
Most of the rest of the poem tells the mariner's fantastic story, but occasionally the framing background from the present and the wedding guest intrude. For instance, the wedding guest exclaims at the mariner's expression when he tells of the horrifying deed of shooting the albatross. Again at the beginning of Part IV of the poem the present and the wedding guest intrude. The mariner has just told of all of his shipmates falling down dead and becoming ghosts, and the wedding guest fears that the mariner is a ghost as well. Again when the dead sailors become animate to help the mariner sail the ship, the wedding guest cries out in fear, but the mariner reassures him.
At the end of the poem, the frame becomes complete as the mariner finishes his tale and shares with the wedding guest why he has told it. He feels compelled to tell his story to certain people who might benefit from it, and so he has stopped the wedding guest and shared the story with him. He closes by reminding the wedding guest of the lesson of the joy of worshiping God and having respect for all living things. The wedding guest takes the lesson to heart and rises the next day "a sadder and a wiser man." Closing his poem within the frame allows Coleridge to share these lessons with readers.