“Homeland,” the standout TV drama of the season, has a number of impressive qualities. It’s a twisty thriller with deep characterization. It has brought Claire Danes’s amazing cry-face back to television. It offers Showtime subscribers a brand-new traumatized, redheaded anti-hero just as “Dexter” went into a tailspin. It made me have the actual thought: “Man, that Mandy Patinkin is one subtle actor.”

But what I love most about “Homeland” is the way it acts as an apology for “24.” The show was created by Howard Gordon and Alex Gansa, former writers for that series. (Gordon created the plot arcs for Seasons 3 and 4, and he was the showrunner from 2006 to 2009.) Their previous hit was popular for good reason: it was a well-made fun machine, a sleek right-wing dreamscape with just enough moral ambiguity to elevate it above a Road Runner cartoon. Unfortunately, “24” was also a carrier for some terrible ideas, among them the notion that torture is the best and only way to get information; that Muslim faith and terrorist aims overlap by definition; and, most of all, that invulnerability is the mark of heroism. Kiefer Sutherland’s Jack Bauer was tortured again and again, but he always bounced up, jack-in-the-box style, to waterboard on. Characters surrounding Bauer did occasionally argue with the show’s premises. But most of them were A.C.L.U. types who wouldn’t know a ticking time bomb if it kicked them in the face.

Gordon and Gansa’s new show is based on “Hatufim,” a serious Israeli drama about prisoners of war, but it shares plenty of its DNA with “24.” Like “24,” “Homeland” is obsessed with the global threat of jihadist terrorism. It features an unstable intelligence operative, Carrie Mathison (Claire Danes), seeking a mole, Nicholas Brody (Damian Lewis). It’s got cliffhangers and conspiracies—a few of which, “24”-style, go all the way to the top.

And yet, in nearly every way, “Homeland” dramatizes the opposite ideas from “24.” Its premise is that trauma doesn’t disappear. Neither Carrie (who bears scars from her time in Iraq) nor Nicholas (who survived a brutal, years-long imprisonment) can escape what was done to their bodies. Whether they are heroic or not is somewhat beside the point. Both have good motives for their actions and also selfish and fearful ones. The pair are linked by their painful experiences, which allow them to empathize with one another’s vigilance and vulnerability. When they finally had sex, the intimacy was almost painful to watch; it made me feel like a voyeur.

On “24,” the torture scenes were the sex scenes. They were part of what made the show so repellent. Without ever acknowledging it, “24” harnessed the nudity and emotional exposure of torture to arouse the audience, to merge our bloodlust with something libidinal. In contrast, on “Homeland,” the literal, and often fairly graphic, sex scenes are the crucial sequences. Some of them (Brody with his wife) are grim and alienated; others (Brody and Carrie’s first time) are frankly hot; yet others (Brody and Carrie’s first sober sex) are played as game-changers, altering the psychological landscape for both participants. These raw, nuanced sequences operate like the songs in a musical: they reveal the true hearts of the characters. And leaving “24” aside for a moment, the “Homeland” erotics stand in notable contrast to the many other adult cable shows—from “Boardwalk Empire” to “Californication”—where sex scenes are regularly offered up, with cynical laziness, as a kind of porn-with-purchase within otherwise “highbrow” entertainments.

“Homeland” is not a preachy show. But in nearly every episode, it buries a narrative riposte to the Bush-era ideology of “24”. In a recent installment, Saul, Carrie’s superior, insisted on handling the arrest of a young American woman terrorist. He picked the suspect up in Mexico, where she was attempting an illegal border crossing, and drove her back to Virginia. Initially, I assumed we were in for another double-cross: Why this long conversation between Saul and this terrorist? Did he have some hidden motive? As it turned out, the show was dramatizing precisely what frustrated intelligence experts had argued throughout the run of “24”: that the best way to get good information is not to apply pliers and a blowtorch, but to build a relationship with your captive, to use their human need for connection to motivate them to tell the truth. And, as it turns out, that’s also exactly what happened to Brody: after years of torture, his captor Abu Nazir treated him kindly, built a complex relationship with him, trusted him with his son, and true fellowship flowered from there.

The politics of “Homeland“ aren’t anywhere near as explicit as those of “24“ (and the season isn’t over, so it could swerve in many directions). But what’s already clear is that, without being agitprop, the series provides a much-needed antidote to a show that was a propaganda arm for the Iraq war. On “Homeland,” we see the consequences of Jack Bauer’s ends-justifying policies: when the authorities lie on CNN about the death of children in Iraq, or frame innocent Muslims to conceal a botched police action, their duplicity—however well-motivated—radicalizes even more enemies. A show like “Homeland” will always have a streak of fantasy, but so far it feels surprisingly grounded in the world we live in. The only thing that could make “Homeland” more realistic would be if some of the characters talked about watching “24.”

Photograph by Kent Smith/Showtime.