When you're initially charged with a crime, you have to plead guilty or not guilty. Typically, the prosecuting attorney will offer you some sort of deal if you plead guilty right off the bat. Otherwise, you plead not guilty and the legal machinery begins to turn (subpeonas, fact finding, depositions, etc.), with the end result being a trial. This takes a while, and the prosecuting attorney will sometimes attempt to sweeten the deal somehow to avoid a trial if they don't think they have an air-tight case against you.
At least, that's how it works in the United States. Since Scotland is also a common law jurisdiction with something of a shared legal history (the union of Scotland and England predates the revolt by the American colonies by nearly a century) I imagine it probably works similarly there as well.