Plea bargaining can be a complex procedure, but in general, it occurs when the State and the defendant, through their respective attorneys, agree that the defendant will plead guilty to one or more pending criminal cases in return for a specific sentence, subject to approval by the court.
A prosecutor assigned to a criminal case will evaluate the facts and circumstances of the case and make a determination of what punishment (sentence) to offer to the defendant in return for his plea of guilty to the charge in the case. This recommended punishment is based on the prosecutor's view of the case and its facts and his or her experience in trial with similar cases having similar facts. The defendant's attorney will make a similar assessment and either advise his client to accept or not. If the defendant does not accept the offer, the case is set for trial. If the defendant accepts the punishment recommendation in return for his plea of guilty, a written plea bargain agreement is signed by the attorneys and the defendant, the defendant pleads guilty, and the court accepts the plea and assesses punishment in accordance with the plea bargain agreement.
The court, however, may not accept the plea or the plea bargain agreement, in which case the attorneys and the defendant may reopen negotiations or the case is tried before the court or before a jury.