The government may offer the defendant in a criminal prosecution a plea bargain or "deal" to avoid the time, cost, and risk of failing to secure a conviction at trial—and the defendant may accept such a plea deal to reduce the risk of a greater sentence. A defendant may only plead guilty if they actually committed the crime and admit to doing so in open court before the judge. When the defendant admits to the crime, they agree they are guilty and agree that they may be sentenced by the judge presiding over the court—the only person authorized to impose a sentence.
Sometimes the defendant and the government/prosecution agree that the defendant will plead guilty—sometimes to lesser charges than the defendant is facing—and agree what the punishment will be—subject to the court’s approval of the plea deal. And sometimes the defendant will agree to plead guilty and the government/prosecution will agree not to recommend an enhanced sentence—but it is up to the judge to determine how the defendant will be sentenced or punished.
If a defendant pleads guilty there is no trial and the next step is to prepare for a sentencing hearing.
In Virginia, plea bargaining is a common practice in the criminal justice system where the government (prosecution) may offer the defendant a plea deal to avoid the uncertainties of a trial. The defendant can accept this deal to potentially receive a lesser sentence than they might after a trial. However, a defendant can only plead guilty if they truly committed the crime and must admit to it in open court. The judge is the only authority who can impose a sentence. Plea agreements often involve the defendant pleading guilty to lesser charges or the prosecution agreeing not to seek an enhanced sentence. While the parties can agree on a recommended sentence, the final sentencing decision rests with the judge. If the plea is accepted by the court, there will be no trial, and the case moves directly to the sentencing phase. It's important to note that the judge has the discretion to accept or reject the plea agreement, and the defendant's admission of guilt must be knowing, voluntary, and based on factual evidence.