Claire Danes returns as Carrie Mathison in the fifth season of “Homeland.” (Stephan Rabold/Showtime)

Even the sleekest shows require constant maintenance under the hood. Sometimes the work that needs to be done in the break between seasons is as easy as quick trip through the Jiffy Lube (refilling a depleted story arc; replacing the filter on a subplot; adjusting for the loss of characters), while other shows require a trip back to the dealer for heavier work — the equivalent of needing to replace the transmission.

Showtime’s “Homeland” and HBO’s “The Leftovers” are two very different kinds of premium cable dramas, but both return Sunday night after some obvious tinkering and a hefty bill for parts and labor. Some of these tweaks hum right along with renewed zip, but (wouldn’t ya know it?) both still are prone to cough and sputter.

Even though it routinely appears on viewers’ lists of favorite shows, “Homeland” always went a bit haywire during the last lap of each of its four previous seasons, which, if nothing else, can be blamed on the fact that it is, in the end, a show about a woman with a mental illness. (A show about a crazy person is supposed to be crazy!)

After a demoralizing series of defeats in Pakistan, “Homeland’s” troubled heroine, CIA agent Carrie Mathison (Claire Danes), spent a couple of episodes in epilogue mode, trying to salvage her life back home in Washington. The result was a season-ender that ambiguously dangled rather than tantalized.

An obvious fix to “Homeland” is also the one most frequently used by other shows — especially espionage thrillers: Flash-forward, a little or a lot.

In Season 5, “Homeland” show-runner Alex Gansa and company have moved the story ahead two years and relocated its setting to Berlin. Carrie, who keeps her bipolar disorder in check with medications, is about as content as we could ever hope to see her — a peace that can’t possibly last. She’s in the private sector now, working as the head of security for a nebulously philanthropic corporation (reminiscent of the corporation seen in “The Honorable Woman” on SundanceTV), which is headed by Otto During (Sebastian Koch).

The job is meant to afford Carrie the work-life balance she never knew. Now she can pick up her toddler, Frannie (yes, Carrie decided to raise the kid, our last link to the late Sgt. Nicholas Brody), after preschool and enjoy quiet nights at home with a suitably mellow partner, Jonas (Alexander Fehling). She even attends daily Mass.

But this isn’t a show about getting cozy. With its masterfully prescient knack for melding international headlines with implausible tales of espionage, “Homeland” kicks off with parallel plots involving the Islamic State and a computer-hacking incident in which thousands of the CIA’s most valuable documents have been downloaded from the agency’s German office through the servers of a local porn­-streaming operation. (In another one of those pleasant, real-world coinkydinks for “Homeland,” Edward Snowden just joined Twitter. I’ve always admired “Homeland’s” fortunate timing, rivaled only by “The Good Wife’s” flair for techie topicality.)

No sooner has the CIA hack been detected than we are back in the world of Saul Berenson (Mandy Patinkin), who has once again found himself in the power chambers of the agency and who travels to Berlin to handle the crisis, which returns him to Carrie’s orbit — even though the two are no longer speaking.

And poor, haunted-eyed Peter Quinn (Rupert Friend) is still out there, assigned to some of the CIA’s darkest and most off-the-book missions. For now, that means it’s up to him to keep “Homeland” at its best and most essentially “Homeland”-ish. Meanwhile, Carrie’s boss is demanding a high-security humanitarian visit to an ISIS trouble spot, and a viewer realizes that this updated “Homeland” runs the same as it always has.

A van screeches up, someone throws a hood over Carrie’s head and she is whisked off to see a Hezbollah muckety-muck. So much for the notion that this newfangled Carrie would get to solve crises a different way. She comes home a little bruised several hours later; there’s just no pleasant “how was your day?” to be had in this woman’s life.

Her day was terrible, honey. All her days are destined to be terrible.

Justin Theroux in “The Leftovers.” (Van Redin/HBO)

Regina King, Kevin Carroll, Jovan Adepo and Jasmin Savoy Brown in “The Leftovers.” (Van Redin/HBO)

But Carrie’s life is preferable, I think, when compared to that bunch of sourpusses collectively known as “The Leftovers,” the 98 percent of the world’s population who did not mysteriously vanish in a rapturelike event on Oct. 14, 2011 — a.k.a. the Sudden Departure.

“The Leftovers” ended its first, difficult season in a way that suggested that HBO knew all along that the show would be a hard fit for both the casual and discerning viewer. In the final scene we saw embattled small-town police chief Kevin Garvey (Justin Theroux) and his lover Nora Durst (Carrie Coon) discover a baby girl on their doorstep (left there by Kevin’s son, who had joined and then escaped a religious cult).

Joined by Kevin’s teenage daughter, Jill (Margaret Qualley), “The Leftovers” left us with the image of an unconventional family of four, assembled from tragedy, but ready to cope. That could have easily served as the period at the end of a sad and convoluted sentence, acknowledging a failed experiment.

HBO, however, is not prone to give up so easily. Co-created by “Lost’s” Damon Lindelof and novelist Tom Perrotta (who wrote the book on which it is based), “The Leftovers” spent Season 1 establishing itself as a psychological exploration of aftermath and the corrosive effects of spiritual hollowness.

That’s still very much the theme in Season 2, but “The Leftovers” has gone in for some heavy maintenance: The story shifts forward several months and now takes place in a small Texas town called Jarden, where, for reasons unknown, not a single person was Suddenly Departed.

Now nicknamed Miracle and surrounded by a national park, Jarden has become a mecca for seekers of all kinds, many of whom hope that the aura of the place (and maybe the water?) will protect them from the possibility of another Sudden Departure. Kevin and Nora decide to pick up and move there, which, if you ask me, is like deciding to go live behind a fence with the evangelical equivalent of the Burning Man festival.

But forget all that, because the first episode of Season 2 actually opens with a long scene of a cave woman giving birth during an earthquake. After the rest of her tribe is crushed by falling boulders, the woman sets out with her infant in search of food. Instead she meets with disaster — both real and Biblically symbolic.

It’s a Garden of Eden story in need of a Prozac prescription, and it certainly gets points for being completely unexpected, but it frankly comes much too soon after the heavy-statement mess made of the second season of “True Detective.”

The cave woman scene also seems to ensure that “The Leftovers” cannot be dissuaded from its initial mistake — which was to attempt to turn Perrotta’s wry and somewhat allegorical 9/11-era novel into something at once bizarre and profound.

Early on, we learn from a TV news report that Mark Linn-
Baker, the star of the 1980s sitcom “Perfect Strangers,” has been found in Mexico, having faked his disappearance in the Sudden Departure. If only “The Leftovers” could give us a lot more of that kind of humor, I think more viewers would be into it.

It’s hard to deny that “The Leftovers” can be both visually and emotionally arresting. It is also hard to deny that it is absolutely no fun to watch, a fact that doesn’t necessarily lead one to abandon it.

The addition of a new family in Jarden/Miracle, the Murphys — headed by strong new cast members Kevin Carroll and recent
Emmy-winner Regina King — is reason enough to tread lightly and see whether Lindelof, et al., have worked out some of the kinks when it comes to pacing and payoff. (If you’re waiting for the big payoff, which would be an explanation of the Sudden Departure, you might as well forget it.)

For all the distance traveled, “The Leftovers” is still an exercise in fleeing from ghosts, sometimes literally: “It’s hard to tell if [the Murphys] are part of your story or if you’re part of theirs,” the ghost of Guilty Remnant cult member Patti (Ann Dowd) says to Kevin.

Soon enough Kevin’s ex-wife (Amy Brenneman) will arrive in Miracle and you’ll get the feeling that nothing’s been fixed here at all. The show is still stuck in low gear.

Homeland (one hour) returns Sunday at 9 p.m. on Showtime.

The Leftovers (one hour) returns Sunday at 9 p.m. on HBO.