From what I understand, the Criminal Division of the Internal Revenue Service is an exception to this question. Its rate of winning convictions is something like 80%, and about half the remaining cases are settled on terms favorable to the IRS. So it loses only a statistically inevitable "handful" of cases, where there might have been unexpected exonerating circumstances.
This varies in different parts of the United States, but from what I understand, prosecutors in some parts of the country sometimes pursue weak cases, usually against poor defendants. They have to prove "guilty" beyond a reasonable doubt," but it seems to me that the level of proven "guilt" in many of these cases is less than in the IRS cases. And it seems that most districts' prosecutions have higher rats of acquittal and/or wrongful convictions than the IRS.
What could be the reasons for this? Could it be that the IRS is a "national" organization while districts are "local" Does the IRS do a better job of picking "guilty" parties than district attorneys because they know that potential defendants have the money and attributes to defend themselves?
(From what I understand, the IRS rejects potentially meritorious cases that come below the 80% threshold, while some district attorneys seem to prosecute based on "probable cause," and get many acquittals, or wrongful convictions.)