Very few attorneys can make a living solely representing innocent people who have been falsely accused of crimes. Perry Mason and Phoenix Wright, for example. But most defense attorneys don't have that luxury. Guilty people are legally entitled to representation too (at least in most modern democracies) and odds are a given lawyer will wind up with at least a few of them as clients.
Now, if the prosecution's case is weak, or you've got a flair for the dramatic, Courtroom Antics and looking for technicalities might win the day. But sometimes the evidence is airtight, the prosecutor is a pro, and the judge has no mercy. At that point, the client's best interest might lie in making a Plea Bargain.
Essentially, the defendant agrees to plead "guilty" to one or more charges, in exchange for a lighter sentence. Often, a lesser charge is agreed to, avoiding a harsher penalty. For example, plea bargaining a felony down to misdemeanor, or an offense that would get the defendant on a "sex offenders" listing down to one that will not. The prosecutor may also recommend a lighter sentence to the judge, usually within the standard range. For instance, crime A is worth 6-9 months, crime B is worth 18-24 months. The accused was originally charged with crime B, but bargains and pleads guilty to crime A, and in exchange, the prosecutor recommends a sentence of 6 months. The judge may choose to give more, but only up to 9 months. Also note that the acceptance of the plea bargain is entirely dependent on the judge: if he or she feels the plea bargain is a gross miscarriage of justice (if a first-degree murder is pleaded down to manslaughter for example), the plea bargain can be rejected. If this happens, expect the judge to rebuke the prosecution. The other side of the coin is the problem with District Attorneys "front loading" the charges and potential sentences against the defendant to encourage a plea bargain. Many defendants who are either innocent or at least believe they have a reasonable chance at being found not guilty at trial plea bargain out - if crime B is worth 5-10 years jail but a plea bargain is available for crime A that allows for 6-9 months jail many defendants would take the plea even if innocent to avoid the risk of spending 10 years inside.
In some cases, the defendant will be required to testify against other criminals as part of the deal, or to provide other services.
And it's a pretty good deal for the prosecution too, usually. Sure, they probably could have gotten a conviction, but full trials take time, and money, and tie up attorneys who could be working on the next case. It has been pointed out many times that if a sizable number of defendants suddenly refused to plea-bargain it would cause a collapse of the legal system, as the government would be unable to hold trials for them all. In the United States as much as 97% of cases are resolved by plea bargaining.note Note that on account of the US' peculiar drug laws, a lot of these are drug cases; evidence tends to be particularly airtight with drug possession—after all, it's hard to say, "no I wasn't carrying any drugs" when the police have the drugs and you before the court—making trials a waste of everyone's time. Because the facts are usually undisputed, usually the defense might make a few perfunctory motions to see if the drugs can be suppressed for some kind of police misconduct, but that almost inevitably fails, and then begins the bargaining. Note also this can be subject to Eagleland Osmosis. In most civil law nations it's simply not possible. Even if you plead guilty they do a full trial to establish how much time you get. In the other Common Law nations, it's officially frowned on and officially doesn't happen. Unofficially it happens all the time, but it's considered very impolite to suggest it. This has been a huge issue at international tribunals. Depending on conditions in the facility a suspect is held in pre-trial, it could also be seen as coercing a confession.
With the vastly over crowded court system, any case which is NOT settled in a plea bargain is one where either the defense feels there is a very good chance to win or the prosecution feels the crime is so bad and has so much publicity they won't.
Because a plea bargain is not nearly as dramatic as a case that goes to trial, the frequency of the two is inverted between Real Life and fiction.
Some dramatic situations that might be seen with a plea bargain:
The attorney tries to get one for a client, but the client has the attitude I Won't Say I'm Guilty, forcing a trial to go forward.
If the client is innocent, an Amoral Attorney—or an overworked one—may pressure him to do a plea bargain anyway, because the case would be too hard to win, or for less savory reasons.
A particularly vile defendant offers a plea bargain that essentially lets him get off scot-free, and the prosecution refuses it.
The main story is about someone else's trial, and the person who made a plea bargain testifies against them as part of the deal. Naturally, the second defendant's attorney will cast aspersions on the witness' motivations and veracity.
In A Few Good Men, LT Dan Kaffee (Tom Cruise's character) has made a career out of skillful plea bargaining, but he decides not to on this case once he sees the emotional damage it'd do to his clients.
Not only has Kaffee made a career out of his plea negotiating skills, but it's pretty much implied that the authorities assigned him to the case with the expectation that he'd plea his clients out, thus preventing the scandalous details of PFC Santiago's death from becoming public.
In The Trials of Oscar Wilde the title character's lawyer is disgusted when he learns that Wilde lied under oath about being gay (it's the lie that he objects to; he feels like Wilde suckered him into betraying his professional ethics). However, he agrees to defend Wilde against charges of "gross indecency" when he learns that the prosecution is offering plea bargains to male prostitutes in exchange for evidence against Wilde - at the time, this sort of arrangement was absolutely unheard of under English law, and the lawyer feels it's a far worse perversion of justice than Wilde's perjuring himself.
The Lincoln Lawyer once pressured a client charged with rape and murder to plead guilty so he'd be sentenced to just 30 years with a chance to obtain a parole after 15 years. That came to bite him hard when he not only learned the client was innocent but he was also defending the actual culprit from an attempted rape charge.
Con Air had an illegal usage of a plea bargain: the judge agreed to the bargain, and then reneged on the terms offered to the defendant.
Averted in Darkness at Noon: whereas other prisoners are made to confess through torture, or to save their own lives or those of their relatives, Rubashov is promised no reward for willingly denouncing himself as a traitor.
There is an episode of Boston Legal that uses this. Alan Shore's client an old friend and fellow lawyer who is accused of murder. She is offered a plea bargain at the beginning but of course won't say she's guilty and has a Big Secret.
Plea bargains are commonplace on JAG, but they're often turned down.
Happens all the time on The Closer and it's After Show, Major Crimes. One instance of it on The Closer is notable because it backfired spectacularly. An elderly shopkeeper and his 8-year-old grandson are shot to death by a local gang member, and the police think that they know who it is. They also think that another gang member witnessed the murder or maybe, at most, was an accomplice. The potential witness is offered an immunity agreement, stating that he won't get charged with anything in exchange for telling them everything he knows, in the hopes that his testimony will be enough to get the other guy. Except it turns out the guy they thought did it was innocent, the "witness" committed the murder himself, and the other guy just happened to come into the shop as the killer was leaving. So basically, they've just let a guy off scot-free for murdering an old man and a child.
The issue of whether or not to accept an offered plea bargain is a common plot point in The Practice. In one episode, Todd Beck was arrested for killing a cop and the victim's partners decided to coerce a confession from him instead of allowing the doctors to give him the needed medical care. To make things worse, the prosecutor in charge of the case was Kenneth Walsh, who condoned the torture. Beck was forced to testify against Joe Moran (a friend of Beck's who was at the crime scene). Walsh then offered Moran immunity in exchange for testifying against Beck. The judge was appalled at this but had to allow this since Moran wasn't forced to testify. Walsh then offered Beck a deal: if he pleads guilty to illegally possessing a gun, he gets six months for that and it'd be officially declared he was justified about shooting the cop. Beck accepted the deal.
In Rumpole of the Bailey, Rumpole ultimately makes a point of never having his clients plead guilty, and any lawyer in the books who even thinks of plea bargaining is seen as a moron. The odd thing is that Rumpole sometimes does lose the case this way, but the story is clearly on his side.
There is one story where Rumpole does end up going for a plea bargain, but only after his client has made it impossible for him to continue believing in her innocence, and his principles won't allow him to defend somebody he knows to be guilty.
By contrast, Rumpole does attempt plea-bargaining at times in the series; the first "Play for Today" pilot had him advise this right off the bat, while in subsequent cases he appeared to be willing to do a deal when (and only when) he could get the client out of jail time, which usually meant that the judge was sympathetic (usually a former member of his chambers—particularly Guthrie Featherstone and Phyllida Erskine-Brown).
In the American version of Shameless Fiona is arrested for child endangerment for accidentally allowing her younger brother Liam to get into some cocaine she had out in the open. Her somewhat overworked lawyer tells her that it would be best to plea bargain, as she's a first time offender, it's a fairly open-and-shut case, and at worst she'd probably only get 1-3 months in jail. Fiona, however, is resistant to plead guilty as the entire affair was an accident, and has to be persuaded to accept the plea deal (she ends up not having to actually serve any time, and is instead given probation).
In Orange Is The New Black, the entire reason Piper convicted is because someone else in the drug ring named her as a part of a plea bargain. She later discovers that the person who named her is Alex.
In the second case of Phoenix Wright: Ace Attorney: Justice for All, the first thing Franziska tells Phoenix at the start of the trial is that he would be pleading within the first 10 minutes of the trial. Phoenix is later gave the choice of pleading or not, but the situation is a But Thou Must and he ends up not pleading.
During Prohibition, "bargain days" were the only way many courts could keep up with the alcohol-related workload. Everyone who agreed to plead guilty in exchange for the smallest penalty the judge could get away with would be scheduled for the same court date, and the formalities were zipped through to clear as many cases off the docket as possible.
Nowadays this often happens (albeit less frequently) with possession charges for small amounts of marijuana. Again, the issue here is that in contraband cases, a trial is generally worse than useless—it would be pointless for the defendant to deny the charge, since the only way you get caught is if the cops actually see you commit the crime (carrying the contraband), so once the defense lawyer has tried and (usually) failed to get the evidence suppressed for alleged police misconduct, the defendant usually just wants to get the business over with.
Canadian serial killer Karla Homolka is one infamous example of a plea bargain. After assisting her husband Paul Bernardo in the murder and rape of three girls (including her own sister) in the city of St. Catharine's, she struck a deal with the prosecutors and received a 12 year sentence in exchange for taking the stand against Bernardo, who ended up getting life. Unfortunately, not long after the trial closed, tapes were found of the murders that revealed that Karla had had more to do with the murders than previously thought. For this reason, the case is often referred to as "the deal with the devil."
Any smart prosecutor would make the deal dependent on her telling the full truth, with the agreement being that it was invalid if she didn't. In the USA, the prosecutor can do this. Such agreements can be worse for the guilty party than otherwise, because they can allow the prosecutor to then use any statements made prior, as well as set aside statutes of limitation.
Whatever deal was made was finalized when the court pronounced its sentence; Canada has legal rules similar to American Double Jeopardy laws that prevent retrials except under specific conditions. The intelligence level of the prosecutor was irrelevant; while it's difficult (but possible, unlike in the U.S.) to retry someone found not guilty, it's most certainly not allowed to try someone a second time for a crime for which they had already been found guilty and been sentenced, regardless of new information.
Roman Polanski's reasons for escaping from his sexual assault case in the USA hinged on technical details of plea bargaining. Polanski and the prosecutor agreed and submitted a plea bargain where Polanski would not be imprisoned, but the judge threatened not to accept these terms and have him do 90 days.
Despite possibly killing close to a hundred people, serial killer Carl Eugene Watts ("The Sunday Morning Slasher") was nearly released in 2006 due to a plea bargain made at the time of his arrest.
Jared Loughner was initially ruled not competent to stand trial after the attempted assassination of Gabrielle Giffords. When he was finally ruled competent in August 2012, he and his lawyers agreed to plead guilty in exchange for a life sentence (Arizona has the death penalty). Considering that it's anyone's guess whether Loughner could have been kept on the "mentally competent" list for the full duration of a trial, the deal was accepted.
Batman Beyond: District Attorney Sam Young's reelection campaign in "Eyewitness" had it mentioned that, during his tenure, the District Attorney's office had a decrease in the ratio of plea bargains for violent crimes.