Fans of the CBS legal drama The Good Wife know that the real appeal of the show isn't the drama that goes on in the courtroom, but in the bedroom. Series protagonist Alicia Florrick, played by Julianna Margulies, is a housewife who must return to the workforce when her husband, Cook County State's Attorney Peter Florrick, resigns in disgrace following a high-profile sex scandal.

RELATED: The Good Wife: 5 Best Main Characters (& 5 Worst)

Alicia's relationships, romantic and otherwise, are what really drive the popularity of the show. But that doesn't mean that it's not a smart, well-written legal drama as well. The main cast of The Good Wife is just as skilled in the courtroom as they are in the bedroom—well, most of them, anyway. Here are all of the series regulars, ranked by how good of a lawyer they are.

Peter Florrick

Peter Florrick, portrayed by Chris North (Law & Order, Sex and the City), begins the series as Cook County State's Attorney. He resigns in disgrace, gets re-elected, rides the wave of public opinion all the way to the Illinois Governor's mansion, and then ends the series the same way he started by resigning in disgrace all over again. Not surprising from a man who can't keep it in his pants.

He clocks in last on this list not because he's a clunker in the courtroom, but because he can't seem to stop breaking the law long enough for his wife to decide whether or not to divorce him. In the rare instances that he actually does his job, it's nothing too impressive. He's a much better politician than a lawyer.

Finn Polmar

Matthew Goode (Watchmen, Downton Abbey) plays this ex-Assistant State's Attorney who starts his own practice and ends up representing Alicia Florrick when she does the same. Though he's introduced on one of the most emotionally wrought episodes of the entire series, the 15th episode of the fifth season, Finn goes on to be a rather unremarkable character.

RELATED: The Good Wife: Every Main Character, Ranked

The writers tried to lend him a little drama, giving him a past that included a sister who died of a drug overdose and a messy divorce. But, in the end, Finn couldn't fill the void that Will Gardner had left in fans' hearts, and departed the series in season six without much fanfare. He's still better than Peter, though.

David Lee

Equity partner and head of Family Law at Lockhart Gardner, David Lee appears in both the original CBS series and the CBS All Access spinoff The Good Fight. He may not be the most likable man, but, when it comes to handling Alicia's (almost) divorce from Peter, he gets the job done.

David Lee is a heavy hitter at the firm, responsible for a huge percentage of their income, though he doesn't get along with name partners Diane Lockhart and Will Gardner. Nonetheless, these sorts of interpersonal conflicts don't seem to bother him. Money is all he loves, and all the love he needs.

Cary Agos

Star of The Resident, Matt Czuchry, started his career in season one as a first-year associate alongside Alicia Florrick. Throughout the series, he is sometimes friend and sometimes foe, but what never changes is the fact that he's a formidable opponent in the office and in the courtroom. At the end of season one, he defects to the State's Attorney's office, and, from there, he takes a meandering path to success.

RELATED: The Resident: 10 Best Episodes, Ranked According To IMDB

Eventually, when he and Alicia break away from Lockhart Gardner to form their own firm, he starts to reach his true potential, but he's often held back by his commitment to personal relationships, especially with Lockhart Gardner's in-house private investigator Kalinda.

Alicia Florrick

As the protagonist of the series, it would make sense for Alicia Florrick to be the most skilled lawyer of them all. But that's what's unique about The Good Wife: it's not a legal drama that's all about the courtroom. Alicia excels outside the courtroom—in depositions and settlements and closed-door meetings—where her ability to empathize with people can really shine.

Alicia is a wildly popular character, not because she's a courtroom superhero, but because she's so relatable to the show's audience. A working mom out of her depth after a long leave of absence from the workplace, Alicia is a champion of the common man, and her ability to balance stressful cases and the drama that her children get into is what keeps fans coming back again and again.

Diane Lockhart

Diane Lockhart, portrayed by Christine Baranski (The Big Bang Theory, Mamma Mia!), is such a formidable character that she got her own spin-off on CBS All Access, The Good Fight. Hardly surprising, since she's one of the firm's founders and name partners.

RELATED: Michael J. Fox To Reprise His The Good Wife Role On The Good Fight Season 4

Diane is the heavy hitter that other lawyers call when they're in trouble, even her co-founder and other name partner Will Gardner. She's also one of the most dynamic characters on the show. Her romance with Kurt McVeigh, a conservative Republican, gives The Good Wife room to explore the clash of political views and the nuance of trying to reach understandings between polar viewpoints.

Will Gardner

Fan-favorite Will Gardner, played by Josh Charles, departed the show in tragic fashion when he was shot and killed in the fifteenth episode of the fifth season. But, before that, this name partner had one of the most important overarching storylines in the entire series: his romantic relationship with Alicia Florrick. Victim to her on-again, off-again relationship with her husband, he never quite got his happy ending.

Nevertheless, Will was one of the best lawyers the series had to offer. He clocks in ahead of his co-founder Diane because of his ability to balance a great legal argument with real human connection. He's the best of Alicia and the best of Diane, combined.

NEXT: The 5 Best & 5 Worst Movie Lawyers Of All Time