You are assuming we have a very capable prosecution system. One capable of prosecuting the right people for the right crimes. One capable of making sure it is indeed serving the public properly.
There are many many many many instances of corrupt Sheriff Departments, corrupt District Attorney's, corrupt Judges. Sometimes they all line up in the same town/country/village/whatever. Most times they are separate entities unto themselves.
My Niece's husband was arrested by a rogue Sheriff's Deputy in Northern Michigan. Except she is the Sheriff's wife... and she was appointed to the spot by some elected officials that were friends with the Sheriff, who was also elected.
The circumstance under which he was arrested, was effectively driving under influence in his truck on his own property through his yard from one garage to another garage to work on the truck. The official charge "Driving Under Influence with intent to drive on public roadways and resisting arrest." Video from the Deputy's car show NO belligerence at all, 100% compliance and very rough handling from the Deputy.
At this point, it has turned into a Federal case, with some serious "shiite" coming down soon on the deputy and some additional charges against the Sheriff's and District Attorney's offices.
This is one of many instances of this kind of things happening. These do happening larger cities, but many/most happening in rural areas, where scrutiny and other kinds of pressure can be applied.