Hamlet is easily the most famous example of a play-within-a play. Even if you haven’t read or seen it since high school, you’ll probably recognize the line, “The play’s the thing wherein I’ll catch the conscience of the King.” And unlike many of his words and phrases, Shakespeare was hardly the first to invent it. Most of The Odyssey unwinds through Odysseus narrating his adventures as a sort of theater to the court of King Alcinous.

The play-within-the-story is an old dramatic device — quite possibly the oldest in the book. But it’s been making quite the comeback on TV lately. Game of Thrones, Penny Dreadful, and Black Sails have all given it a modern update and shown how it’s just as impactful today in peak TV as it was centuries ago, onstage.

Arya watches a play about the events of Season 1 in 'Game of Thrones' 

The recent Game of Thrones episode, “The Door,” was jam-packed with so many big moments — a major character death, a long-awaited revelation, a casual dong shot — that few people are discussing its quieter moments. But Arya’s storyline offered a fascinating and moving scene in the form of that play-within-the show. It was a wonderfully meta scene: Arya and audiences were treated to a distorted, funhouse mirror version of the plot in Season 1.

A play-within-the-story is a way for the narrative to break the fourth wall without going full Deadpool. While the device can be gimmicky, when done well, it transforms the story from a flat surface into an interactive map — just like the Game of Thrones opening.

It doesn’t have a to be a full play, either. In the first episode of its third season, Black Sails featured a brothel scene in which whores and pirates put on a bawdy pantomime to mock the impending doom of Nassau’s former de factor ruler. A whore wearing an elaborate black headdress pretended to kill a man dressed as Eleanor while the crowd cheered. At the time, it just seemed like the usual slice-of-life scene of life in Nassau: Pirates and whores making light of Eleanor’s imprisonment.

But later in the season, when Flint is borderline suicidal, guess what his subconscious idea of death looked like?

While the figure is wearing more clothes than the brothel version, it’s unmistakably the same costume. It’s a serious scene, but it’s also a bit of a joke: Because Flint has been privy to Nassau’s brothels for so long, their pantomimes have bled into his subconscious. Their absurd rendering of “death” becomes an eerie specter in his daydreams. Black Sails uses the play-within-the-story not to uncover new information like in Hamlet, nor to provoke a reaction like Game of Thrones does for Arya. It’s more interior, here: It gives us a window into an inscrutable character’s mind by tracing his phantoms and life history. If it were an isolated creature we were seeing for the first time, it wouldn’t hold nearly the same level of meaning.

Of course, stories-within-stories are an age old trope of the gothic, so it’s no surprise that Penny Dreadful joins Game of Thrones and Black Sails in the modern-TV practice of Hamleting it up.

But it uses both the Black Sails method of showing the play to explore a character’s past and the Game of Thrones method of provoking a reaction. In Season 1, before we knew of Ethan’s beastly nature, watching him become distressed as he watched a werewolf onstage was the show’s version of a sly wink. Even as Brona applauded in delight, the scene was all about Ethan’s reaction. In Season 3, Vanessa and a benign zoologist named Dr. Sweet — who is secretly Dracula (don’t worry about it, Penny Dreadful is great) — go see an ocean-filled pantomime of Twenty Thousand Leagues Under The Sea. They do this ostensibly because it’s Dr. Sweet’s favorite novel, but the visual of a boat and waves parallels another character (Caliban’s) sea journey.

In the following episode, what initially seemed to be a neat visual is revealed to be much deeper: “A Blade of Grass” shows that Vanessa and Caliban have a history that extends further than either character thought.

The play-within-the-story, then, serves as a visual foreshadowing of their connection. In plays-within-stories, one is always more “real,” while the other is more “false.” But when these parts things work well together, they elevate the overall narrative into a whole that’s stronger and slyer.

Plays-within-stories might be an ancient drama device, but today’s most interesting shows prove that the past is very much alive on TV.

Photos via HBO , Showtime