“You don’t want to live here alone,” the apparition of Will Gardner (Josh Charles) told Alicia Florrick (Julianna Margulies) during the series finale of “The Good Wife.” “It would drive you crazy.” Alicia had been imagining what her life might be like if she stayed with her husband, Illinois Gov. Peter Florrick (Chris Noth), whose inability to stay out of ethical and marital trouble kicked off the plot of the series; if she left Peter for hunky private investigator Jason Crouse (Jeffrey Dean Morgan); or, most fantastically, if Will hadn’t died in a courtroom shooting.

But while the manifestation of Will advised Alicia to choose passion with Jason, rather than a stability shot through with humiliation with Peter, his larger point was the more tart and relevant one. I think a lot of observers were disappointed by the fact that “The Good Wife” wrapped up its seven-year run by focusing on Alicia and her one-time mentor Diane Lockhart’s (Christine Baranski) marriages. For me, though, there was something powerful about focusing on both women’s loneliness and vulnerability. The very title “The Good Wife” encourages us to focus on what it means for a woman to be a good spouse to someone else. But the ultimate answer to the persistent questions about why women stay with men who have betrayed them requires us to look at what it is that these women get from their partners, too.

Before I delve into that particular mystery though, a quick recap. As the series wound to a close, Alicia and Diane were working on defending Peter from the latest disaster he has created for himself. And in the course of getting Peter the best deal possible — an outcome that would give Alicia the option either to truly reunite with him, or tie up her family’s loose ends and move on to be with Jason — Alicia called Diane’s husband, ballistics analyst Kurt McVeigh (Gary Cole), to the stand and not only professionally discredited him, but did so in a way that also forced him to admit to an affair.

“The Good Wife” began with Alicia slapping Peter for what he’d put her through publicly. The series ended with Diane slapping Alicia for putting her in the same position. I completely understand how some viewers might read that scene as a catfight. And I suppose I can also understand feeling frustrated that Alicia’s personal life played such a significant role in the conclusion to a series that has often been about how she restored her sense of self and dignity through her work.

But the ways in which Alicia has been revitalized — and in some ways, distorted — by her legal work are well-established at this point. We don’t need another episode that affirms her excellence and the ruthlessness she has learned as the years have gone by.

And I think the unease at the focus of the finale gets at an upsetting idea at the heart of “The Good Wife.” It might be nice for us to tell ourselves that the most liberating, most positive thing Alicia could do with Peter is kick him to the curb, that no woman should feel as though she needs a marriage that is humiliating her and holding her down, that a fulfilling career can be a substitute for a family.

But that fantasy works only if there’s something that comes after dumping a cheating husband. “The Good Wife” can be as brutal as “Game of Thrones” at reminding us that sometimes, happily ever after is shattered by recrimination and bloodshed, or that a knight in shining armor might be a compromised, wandering illusion who disappears down a hotel service hallway. Sometimes awful compromises are the happiest ending on offer.

I don’t think it makes Alicia weak to be lonely, to want some handsome man there with a glass of wine for her when she opens her apartment door, needing her to anchor him, or to make him want to be good. I don’t think it makes Diane catty to want her marriage to be strong, and to hate that the woman she took in and mentored professionally after a personal humiliation has now served up the same imperfect choices and public scrutiny to Diane herself. And I don’t think it makes a character — or a real woman — any less strong to make flawed choices when the options before her each come with their own sort of pain.