Part of a dispute can be settled, with the remaining issues left to be resolved by the judge or jury. Criminal cases are not settled by the parties in quite the same way civil cases are. However, not every case goes to trial. The government may decide to dismiss a case, or be ordered to do so by a court. The defendant may decide to plead guilty, perhaps as a result of negotiations with the government that result in dismissing some of the charges or recommending leniency in sentencing.
Plea bargains are a very important and efficient way to resolve criminal cases.