Homeland is one of TV's most viciously cynical shows.

Everybody has a price. Nobody has integrity. The real story is being crafted behind the scenes, by world-weary spies and operatives who on some level want to keep people safe but who also want to advance their own careers. Its lead character functions so well in this world not in spite of her bipolar disorder, but because of it; to live in the Homeland universe is to accept that mania and depression are the only two possible responses to how little control you have over your own life.

Related Carrie Mathison is the most influential TV character of the 2010s

The show's fifth season has featured its most sustained excellence since the vaunted season one (when it won the Emmy for Best Drama Series and briefly became the next big thing).

Where the fourth (also good) season benefited greatly from Homeland's facility with an action sequence, the fifth was much more interested in following the show's characters into quiet rooms to observe the subtle power plays and games of manipulation played behind closed doors. The season's major terrorist attack was thwarted, but the character who frequently serves as the show's moral conscience still likely died.

Season five was a grim, nasty piece of TV. But it was also excellent, the closest Homeland has come to emulating the great spy novels it so clearly wishes to ape.

On Homeland, everybody's complicit in something awful

Season five mostly made headlines because a couple of artists who were hired to work on the show's sets painted messages decrying its treatment of Arabs, written in Arabic — that appeared in the background of a few scenes. (Producers, embarrassingly, didn't even notice.) And Homeland, indeed, tends to feature Islamic terrorists, to the exclusion of other Muslim or Arab characters. There have been exceptions — including, fascinatingly, an Arabic atheist who supports ISIS — but for the most part, Homeland buys into the old 24 canard that 95 percent of Muslims and people of Arabic descent on screen are terrorists.

This has long been the show's most troubling aspect. Yes, its characters are spies, working to avert terrorist attacks that would hit the US from overseas. And, yes, the world contains Islamic terrorists. Still, Homeland often seems guilty of too-easy conflation, of suggesting that the all-American heroes are good, while the all-Arabic villains are evil.

When Nicholas Brody (Damian Lewis) was alive, the show could straddle that line, because he was both all-American and plotting acts of terrorism against the US. His presence allowed the show to ask complicated questions about what makes someone a terrorist, particularly if he hasn't committed any actual terrorist acts, via the guise of the sort of handsome hero we'd grown accustomed to seeing in stories like this. But Homeland has sometimes struggled to explore this topic since Brody's death at the end of season three.

Its solution to the problem has been, essentially, to have its characters sway closer to their darkest selves than to their best selves. In the grand tradition of spy novelist John le Carré, Homeland has always argued that espionage wears down the soul, until it's a hardened little nubbin with no feeling in it. Characters like Carrie (Claire Danes) and Saul (Mandy Patinkin) cling to the few remaining shreds of their humanity with everything they have, but every season wears away at them a little more. They live in comfort, yes, but they also have to live with everything they've done.

But Homeland has gone even further in seasons four and five, by matching its central characters so closely to the nation they call home. It argues that building a security state at all means you'll inevitably start making compromises with your values. And once you start doing that, what's the point? Homeland argues, through its characters, that the US can never escape its own worst choices, no matter how hard it may try.

The series has always used Carrie as a kind of symbolic exemplar for US foreign policy as a whole, at least on a broad, thematic level. In season five, she tried to get out of the game entirely, to work as part of a security detail for a Berlin-based NGO. But her past kept catching up with her.

First, files were stolen from a CIA server by hackers who essentially cosplayed as Edward Snowden for a few episodes. Then somebody kept trying to kill Carrie for sins of the past. The implication was clear: The US could adopt strict isolationism and pull out of every country it has interests in, but it will always be on the hook for the things it has done. You can't escape the past. It ain't even past.

Intimacy has always been this show's strength

Homeland's most striking choice in season five was to veer away from action-movie tropes and into the very thing that always set it apart: the intimacy of its storytelling. Season four had proved, somewhat definitively, that the show could do tense standoffs and action-packed sieges with the best of them. So season five boiled down to a bunch of tense conversations in small rooms.

When a threatened sarin gas attack unfolded in the season's final few episodes, it was stopped not by blowing up the terrorists' base but, rather, via deductive hunches and good detective work. The closest thing season five had to an actual action sequence was a lonely shootout that was interrupted by a speeding subway train; a season of 24 it was not.

What this meant was that Homeland's team of directors, led by Lesli Linka Glatter, turned the season into a long series of close-ups, holding on the characters' faces as they contemplated information or tried to sway someone to their cause. In this regard, the series emulates le Carre's George Smiley novels (which include probably his most famous work, Tinker Tailor Soldier Spy). The characters of Saul and Carrie are well-known to us now, so the series can use them almost as spices and seasonings in stories that center on other people — and then immediately turn around and refocus on either of them at a moment's notice.

Nowhere was this clearer than in the season's central story about a high-ranking intelligence officer named Allison (Miranda Otto). Homeland quickly set about making Allison vital to the story's center, mostly by giving her ties to the existing characters. She was an old friend of Carrie's, and, more importantly, she was Saul's new lover.

She also might have betrayed her country to sell secrets to the Russians, and she was definitely behind the attempts to kill Carrie. Homeland quickly became a character study concentrated on Allison, which led to its most sustained stretch of great episodes since early season two (when another major character — Brody — saw his true colors revealed). But it also became a study of Carrie and Saul in relief. Why did Carrie not become Allison? And what drew Saul to Allison?

What makes Homeland feel richer as it gets older is that it no longer has a nervy "Marine becomes terrorist" plot line to fall back on. Instead, it's taken on a certain world-weary quality, with the characters increasingly feeling as if any escape is impossible. Somewhere along the line they made a bad call, and that bad call will always be there, waiting for them in the dark.

Homeland might have its problems, but at its core, it's a complicated, compelling examination of one big idea: We're all compromised. We're all weak. And we're all going to fail. But we act as if none of that is true — of either people or nations — and then we find ways to ignore the crumbling wreckage.

Homeland season five is available on Showtime Anytime.