Los Angeles County D.A. office has a 96% conviction rate (which I understand is actually a little low; I've read it's 97% for Federal courts). Do you really think 96% of people who are prosecuted are in fact guilty? Such laws make a plea bargain an easy win for the D.A.'s office, thus no need to test the law before a
possibly-skeptical jury.
Actually, I do.
Most prosecutors are very aware and very concerned about their conviction rate. They are hesitant to prosecute the case unless they are positive they can win it. Sometimes, if it's a high-profile case or a particularly bad individual they can be pressured into trying for conviction even if there are some problems with the case, but in general, any case with problems is dismissed out of hand.
From my own experience, there are far more cases where the prosecution and the cops absolutely know, beyond doubt, that the person is guilty but the case nonetheless never comes to trial than there are cases of innocent people being convicted.
Sometimes it's because because some of the knowledge they have is inadmissible in court, sometimes witnesses vanish, sometimes evidence is improperly handled, etc.
In general, the cops want to have every case tried where there's a possibility for a conviction; prosecutors are far more cautious. And thus, the conviction rates are very high – because they only deal with slamdunk cases – a stacked deck as it were.