This is because anytime there is an absolute chance they'll lose, they drop the case.
And if the case is less than a 100% guaranteed slam dunk, they'll ask for a plea so it'll never go to trial.
Prosecutors cherry pick their trials. It's not possible for every prosecutor everywhere to keep a 98%+ average trial conviction rate in a normal system.
Let me rewind a little bit in my own life. I probably could have fought my charges a little more, but the risk outweighed the reward. You go to trial and anything can happen. Was I 100% innocent, no. Was I 100% guilty, no. But because at the time I was arrested my co-defendant had disappeared (I believe he is still wanted but I have never followed up and the past is the past to me) the focus of the prosecutor at that moment in time was squarely on me. The prosecutors offered me a plea that was almost too good to turn down. Looking back, and after talking to a bunch of people, I probably should not have taken the plea, but you can't go through life second guessing your decisions.
Knowing what I know now, IMO, the better your plea deal the less confident the prosecutor feels about the case. I was looking at a minimum 10 year sentence. I took a plea for one year supervised probation. I took the plea for several reasons. First, going to trial would have cost me at bare minimum $50,000-60,000 in attorney costs (contrary to popular belief your ability to obtain a public defender is based on your income, and assets you have access to, and I did not qualify). As it was I had already spent close to $12,000 on attorneys. The second reason I chose the plea over trial was that going to trial would have been a long, drawn out process where the result may or may not have gone in my favor. You are putting your life in the hands of a judge or jury. In the end my decision to take the plea boiled down to cost and knowing that within 1 year I would be done with everything and could move on with my life. If I had gone to trial, it would have cost a lot more and at the time I was finishing probation I would probably just be going to court. I took it as an easy way to lick my wounds, learn from my experience, and put my life back on track quickly.
Funny side story of it all. When I first started discussing costs with my attorney I asked him what his thought was on total costs. He replied that there were two questions he had for me in determining cost. First, did I want him to play golf with both the judge and the prosecutor, or just the prosecutor. And, the second question was how many games of golf I wanted him to play with them. I laughed and told him as many as it takes. Looking back part of me thinks he may not have been joking. Our legal system is full of I'll scratch your back, you scratch mine scenarios.
Reminds me of the time I was learning to drive a stick shift in west texas. My dad was in the passenger seat, and was giving me tons of grief for rolling through a stop sign while paying too much attention to the clutch.
We stopped at a gas station, and a local cop pulled into the pump next to ours. My dad, to tease me, asked the cop how much a ticket for rolling through a stop sign would be.
The cop said "About $100. But let me give you some advice. If you offer the officer the $100 right then and there, you'll save a lot of time and paperwork, and your insurance won't have to find out about it, which can save you more in the long run. It really pays to keep some extra cash in your car."
My dad went poker-faced and said "Thank you for the advice", and then he drove us back home and said "Forget everything that man said.
Edit: I'd really like to see how all the downvoters would like to defend their stance. It's obvious that prosecutorial misconduct is not happening when prosecutors abandon cases that are marginal, but when they are harassing people they don't have a chance of getting convicted.
Unless you want to assume that the court is so broken, it will willy-nilly convict innocents.
But then it doesn't matter much what the prosecutor does, then the justice system is utterly broken.
Racial disparities, emphasis on victimless crime, asset forfeiture, prison overcrowding, and oh, the fact that USA has a much higher incarceration rate than any comparable polity ever in the history of the human race.
E.g. a society is generally entitled to criminalize activities it does not want people to engage in. That some other people may perceive the crimes as "victimless" is neither here nor there. I'd imagine that very few people convicted of drug crimes are not in fact guilty of those crimes, because the evidence in those cases is usually overwhelming (e.g. caught with physical product in hand).
Similarly, the U.S. has had about 5-10x the murder rate of, say, the U.K., going back probably a century or more, long before the recent rise in incarceration rate. So the fact that the U.S. has a high incarceration rate does not by itself mean that innocent people are being put in prison.
And anyone is ever guilty only because we define it to be so. In the state of nature, robbing a store and killing the clerk is simply the stronger animal exercising its free will over the weaker. And if robbery is illegal because we say so, I fail to see how the robber is less guilty of the crime because one country punishes him with 3 years in prison while we punish him with 10.
I don't see "don't smoke or sell pot" anywhere in the Ten Commandments.
For one, they are obligated to investigate any exonerating evidence and circumstances, and any exculpatory circumstances. All of this must be revealed fully to the court and the defense, prior to the main trial.
For another, they must only charge when they believe that a conviction is more probable than an acquittal ("my chances are at best 20%, but let's see how it goes" would be clear misconduct).
In practice, the conviction rates are more than 90%, for sure (if you count a conviction for a lesser crime).
As a prosecutor once told me: trials can be freak events. After listening to the witnesses firsthand, or after some dramatic revelation, everything can look much different than it looked in the file. But other than that, they almost always win at least partially.
And another reason is workload. Apart from really high profile, highly publicized cases, resources are extremely limited and prosecutors mostly try to close the files.
But I think you're right: I think it's desirable that prosecutors let go of most cases in which they're not confident of a win. That's called "prosecutorial discretion". If caseloads are high, we want them working on the clearest-cut violations --- maybe with some public policy stretch cases sprinkled in.
Sometimes that's a risk worth taking, but not often. Acquittals are a bad thing.