As an example, in a recent case that I'm familiar with in Oregon, a man that I personally know was unjustly charged with 4 criminal charges that the DA knew were unjustified. He fought. He won. He now has, in addition to a crushing legal bill, a bill for the time he spent locked up in prison on trumped up charges?
Why did this happen? Various reasons. When bf unexpectedly comes home to find his gf having sex with the husband of the house that they're house surfing at, the upset bf can get the gf to make up a rape case. (The guy shouldn't have been having the affair, but it wasn't rape.) When said husband is a Native American in a rural area, the DA knows that given racism and the fact that the guy was doing something dislikable, there is a reasonable chance of winning no matter what the facts happen to be.
But in my opinion the biggest single factor is that the DA in question is an investor in the private jail to which he sends people. When the DA can use the powers of the state to send people to prison, and PERSONALLY PROFITS from this, abuse of power is only to be expected. And even when the DA loses - as in this case - the prison still gets paid. And if the bill doesn't get paid, care to guess whether a hard line will be taken...?
I have no idea how widespread this type of conflict of interest is. I suspect that it is much more widespread than most people think (because the people who run private jails are well aware that getting the DA on board generates profits). But as long as it mostly impacts poor people that nobody cares about, it won't be a political issue.