Every Sunday, we pick a new episode of the week. It could be good. It could be bad. It will always be interesting. You can read the archives here. The episode of the week for November 29 through December 5, 2015, is "Hell Bent," the season finale of the ninth season of BBC America's Doctor Who reboot.

The ninth season of Doctor Who wasn't perfect, but it was remarkable.

Few TV shows have followed up a season as formless and going-through-the-motions as Doctor Who season eight with one this vital and rejuvenated. Usually, a season as by-the-numbers as season eight presages a more general decline across the board. Yes, Peter Capaldi is terrific as the Doctor, a strange alien who travels through time and space, but that wasn't enough in a season that sometimes suggested showrunner Steven Moffat had run out of ideas.

But here's the thing: Season nine didn't improve by wildly reconfiguring itself or doing a hard reboot or anything like that. Indeed, many of the problems with season eight (and Moffat's run on the show in general) were still present and sometimes even still problems.

And yet the show was on fire this season — particularly in its second half. It's all thanks to one weird trick.

In season 9, Doctor Who switched to two-parters almost exclusively — and was all the better for it

Notably, the season's most disappointing episode was also the one that stood independently of everything else. Episode nine, "Sleep No More," was an occasionally agreeable riff on "found footage" horror films that failed to take flight. Scripted by the generally good Mark Gatiss, the hour felt cast adrift in a season that mostly aimed for the epic.

The reason for this is simple: The season's other episodes were part of larger stories, and were typically two-parters. An episode would set up a situation and then resolve it in the next week, and that gave the show's sometimes too-hectic pacing room to breathe.

Also notably was that season nine's stories weren't really part of a more ambitious, serialized story arc. Outside of the three-part finale and a general sense that the season's mysteries swirled around the Doctor's home planet of Gallifrey, the various two-parters were refreshingly free of connections to each other. If this TV year as a whole has made a great argument for why the medium still needs standalone episodes, season nine of Doctor Who has made a great argument for the idea that those standalones can come in many forms.

For instance, the season's fifth and sixth episodes, "The Girl Who Died" and "The Woman Who Lived," offer two very different views of the same character, a young Viking girl named Ashildr (played by Game of Thrones' Maisie Williams). In "The Girl Who Died," she's full of life and hope, working on puppet shows and other inventions. And when she dies, the Doctor finds a way to resurrect her that will also make her immortal. In "The Woman Who Lived," Ashildr — who still appears to be a teenager — has been alive for centuries, and the pieces of her that made the Doctor and his companion Clara (Jenna Coleman) decide she should be saved in "The Girl Who Died" have been hollowed out. She's colder, less caring, less human.

Or consider how the season's concluding three-parter tells three very different stories about the same basic thing — the Doctor's grief over the loss of Clara, who dies confronting a horrible force known as the Raven. Clara submits to the inevitable in the 10th episode, "Face the Raven," and in the 11th, "Heaven Sent," the Doctor spends 2 billion years fighting a fairy-tale monster in order to have a chance — no matter how slim — to save her.

"Heaven Sent" is the season's high point, one of the best TV episodes of the year, a tour de force from Capaldi, who utters every line of dialogue in the script, save one (spoken by a Clara who lives in the Doctor's imagination). What's amazing about it is how effectively it bridges the space between episode 10 and the finale — while still functioning entirely as a standalone puzzlebox episode. All you need to know to understand it is that Clara has recently died. It also unlocks an even bigger reason season nine was so good.

Steven Moffat has turned his weaknesses into strengths

In "Hell Bent," Moffat sends the Doctor back to Gallifrey in a last-ditch attempt to have the other Time Lords resurrect his friend. Moffat wrote both "Hell Bent" and "Heaven Sent," and they're rife with the sorts of ideas that have hurt some of his other seasons. The stories aren't stories so much as they are puzzles to be solved. The Doctor is an indestructible force of awesomeness in the universe. And the characters other than the Doctor — especially his companion — mostly exist to reflect his own awesomeness back at him.

So why did season nine — and the "Hell Bent"/"Heaven Sent" pair of episodes — work where others failed?

The two-parters helped. They lifted the burden of writing a massive puzzle to solve every week, instead allowing more space for the character moments that made Moffat's best scripts sing before he took over Doctor Who. And the character work saved even two-parters that were slightly lacking in terms of story structure, like "The Zygon Invasion," a two-part, alien-filled episode that all boiled down to an ultra-elaborate game of "how many fingers am I holding up behind my back?"

"Zygon" also pointed to something that made the season, and the finale in particular, successful. Moffat has always been interested in questions of violence and war. One of the reasons the writer so loves the Doctor is that the character solves problems through cleverness, not violence, at least as a matter of course. The Doctor would rather outthink a villain than punch him, and Moffat's fondness for this approach is why so many of his scripts become puzzles for the Doctor to solve.

Yet season nine went even further than this. Nearly every episode — even the weaker ones — offered up some sort of meditation on war, violence, and the grief that stems from (and causes) both. Here, check out this speech from the "Zygon" two-parter:

That's as succinct an explanation of Moffat's worldview as anything he's done. War and pain don't have to be inevitable. You can talk your way through — or out of — your problems. You can embrace the better angels of your nature.

Importantly, the Doctor struggled with this idea throughout the season. The premiere two-parter (which, it should be said, was one of the weaker stories of the season) places him up against his greatest enemy, the Daleks, and invited him to destroy them as surely as they would him. (What he doesn't know: Clara has become trapped inside one of their metal salt-shaker bodies.) Other episodes have invited the Doctor to become a "warrior," but actively questioned whether he needs to fight with weapons or his wits. And then there's the finale.

"Hell Bent" brought the season — and an era — to a close

Fans of Doctor Who have known for ages that Coleman was leaving the series at the end of season nine. Clara has been an occasionally interesting character, especially when the show let her function as the Doctor's conscience, but she has also absorbed the worst of Moffat's "characters as puzzles to be solved" tendency, and the deeply felt connection between her and the Doctor didn't always make a lot of sense.

Her death in the first episode of the finale trilogy shocked some reviewers, but the Doctor's need to have her back in his life in the two episodes that followed manages to make him at once more human, in that his friendship with her feels much more integral to his character, and more godlike, in that he spends 2 billion years punching through a wall made of diamond and somehow convinces seemingly every Gallifreyan to cast down their weapons and join his side rather than apprehending him.

Yes, "Hell Bent" is messy in places, racing through all of time and space without so much as taking a breath. But what makes it work is that Moffat has found an emotional and thematic core to concentrate on. War and violence don't have to occur. And if they do occur, maybe you can be spared grief as well. Maybe you can end pain — even your own. Except, of course, you can't. Even if you ended all war and violence, there would still be grief and pain. Immortal Ashildr, who lost her children, could have told the Doctor that.

The bitter irony is that the Doctor does manage to resurrect Clara. It takes some doing, but she's soon off, floating through the stars in her very own time machine, with Ashildr at her side. The cost of her resurrection, however, is that the Doctor must wipe his memory of any trace of his friend, the better to protect the universe.

Grief and pain often cause war and violence. Somebody hurts someone we love, and we can't see straight. The Doctor's arrival on Gallifrey wouldn't have happened if he didn't think he needed to save a dead friend, and season nine is filled with horrible wrongs that are paid forward in even greater pain. In order to protect the universe from his enormous power, he must rid himself of the one person whose loss might push him toward utter desolation. Political philosophy 101 this isn't, but for a show that's technically aimed at kids, it's surprisingly nuanced.

The episode also makes great use of Capaldi, the first older actor to play the Doctor since the series rebooted in 2005. He has the haunted eyes and craggy face of a man who's seen some shit, and he perfectly sells the idea that the Doctor might have seemingly endless power — but he's still driven by rage and hope as surely as any of us. His lectures, such as they are, work, because he speaks with the authority of someone who knows what he's talking about.

And in "Hell Bent," Capaldi turns the Doctor and Clara's final moments together into a kind of beautiful bedtime story, with the two clinging to each other as long as they can, until she is erased from the old man's memory. Doctor Who is at its best when it features the mystery — and dream logic — of a fairy tale whispered to a child before bed. In its ninth season, it rediscovered that quality in spades, and it rediscovered something else as well: a reason to exist beyond its own cleverness.