The worst thing that can happen to a prosecutor is to lose a case at trial. Careers can be adversely affected by the inability to secure a conviction at trial. Prosecutors are therefore very risk averse and reluctant to go to trial. Additionally, they are very under-resourced and over-worked, and the last thing they want is to see all 50-75 of their cases proceeding to trial. Accordingly, they will go far in offering incentives to the defendant to take a "deal" and avoid going to trial. This is why more than 90% of the cases brought to court never make it to trial and are instead resolved with plea bargains.
A plea bargain is any kind of resolution short of trial. There are many formal resolution vehicles that are available to prosecutors, each with its own upside and downside, and it's important that your attorney be aware of all the subtleties and nuances of each individual type of plea available.
Most plea bargains have several things in common. There is often a list of "conditions" that must be satisfied by the defendant in order to keep his end of the bargain. This may include getting drug or alcohol treatment, or sex offender treatment from a licensed provider. There may be a requirement that the defendant have no contact with children or with particular persons. There may be an agreement of a shorter jail sentence, or no jail at all. The types of deals offered are wildly variable and very fact dependent. The point of all of them is to give the defendant something in exchange for his willingness to take a deal and avoid going to trial.
It's important to note that in Washington State, plea bargains are not binding on a judge. Even if the prosecutor and defense lawyer agree on a "no jail' plea bargain, and the defendant pleads guilty in anticipation of getting the no jail sentence, the judge has the final (and only) say in determining the sentence given and can ignore the deal at will. Once a judge has done this, you cannot withdraw your guilty plea for this reason, you're stuck with whatever sentence the court gives. It's therefore critical that your lawyer be familiar with the sentencing judge and that judge's practices in honoring plea bargains that have been made between the attorneys.
There are many reasons that a defendant might want to take a plea bargain, even if innocent. I've represented clients who were charged with crimes that carried severe punishments - decades in prison - and were subsequently offered a no-jail misdemeanor plea bargain. These cases are often weak to begin with and the client feels strongly about going to trial to vindicate their innocence. But when presented with the risk of decades in prison vs. a misdemeanor record with no jail, it may extremely tempting to take the deal. This is a decision that only the client can make, and I do my best to present every option and keep my client informed of the risks and the benefits. I am a trial lawyer and I will always prefer to go to trial over taking a deal, but I'm not the one who has to live with the consequences and my only concern is what is best for my client. I will always understand and respect my client's wishes when the time comes for a decision.