It's no secret that the overwhelming majority of criminal cases never reach trial. The prosecution may dismiss charges, perhaps because of a lack of evidence. Sometimes prosecutors decide not to refile charges after a felony defendant prevails at the preliminary hearing. And some defendants escape conviction through pretrial motions, like a motion to suppress evidence. But most cases end pursuant to a plea bargain.
Plea deals often make sense for both sides. The government doesn't have the resources to try every case. Plus, it sometimes doesn't want to run the risk of acquittal. Defendants, on the other hand, usually receive lighter sentences and/or end up with less serious charges on their records by agreeing to plead guilty (or no contest). Plus, paying a lawyer for representation through trial and sentencing can be quite expensive. (See Using a Private Criminal Defense Attorney.) On top of that, the trial process can be harrowing.
The conservative estimate seems to be that over 90% of cases end in guilty pleas. The United States Courts website estimates that more than 90% of federal cases resolve this way. A 2012 New York Times article reported that 97% of federal cases and 94% of state cases end via plea bargain. (See State vs. Federal Prosecution.)