See, I'm an optimist. I always believe in the good in people and believe that people are generally good. This is hard for me to believe without any sort of evidence. If you just say "police are evil and racist and secretly Hydra and want to keep the little man down" that just sounds to me like a comic book fantasy.
I don't think the police are evil and racist. I think the police institutionally have their agenda set by "the government", and therefore the question is who and what do the government represent.
So at one time we were probably communitarian hunter-gatherers. Then we developed agriculture, and this allowed the ability to amass wealth. This meant autocracy, oligarchy, aristocracy; all of this structure fundamentally maintained by the ability of the wealthy to have a bunch of bully-boys to forcibly requisition goods from the populace. In a sense, this was also a protection racket, because those bully-boys would also protect the masses from
other monarchs' bully boys. But fundamentally, what's going on here is that the state's use of force is designed to maintain a system that mostly benefits the elites and legitimises their wealth and rule. Let's remember of course that the elites
also make the law, and thus the social order itself - which conveniently enough allows them to have palaces whilst their people live in huts. Crime, in that sense, is what the government wants it to be: which is what disrupts the social order that the government has set up.
So the police as we now have them really derives from enforcement taken away from the whims of local aristocrats with private armies. (Take somewhere like South America, powerful landowners still have their own de facto private armies). But the fundamental concept is still maintaining the social order.
Head off to a more autocratic state, and even though the crypto-dictator plainly rigs the election and millions turn out to complain, where are the police here? Mostly, defending the crypto-dictator, because he's the government and societal order: but they know as well as anyone what a farce the fake election was. Justice rolls in a bit behind their institutional function, and they flip at the point it becomes clear the authority of the government has collapsed, not at the blatant injustice. We can take the UK, where the police force's reluctance to investigate MPs and other senior government officials is legendary, where plebs are handed out fines and arrest warrants like confetti. You can see it different police attitudes to who is the victim of crime. Murder a wealthy heiress, hold everything, that shit needs sorting out. Murder a street prostitute, the department's worst detective is going to pop along, suck air through his teeth, do some cursory investigations, and write it off three weeks later as unsolved.
So you take the police in a 1950s southern US state, it's a bunch of white guys taking their orders from white politicians who derive their positions from white voters, and particularly the influence of rich white voters. It doesn't matter whether any indvidial cop is personally racist, the whole institution is set up to serve certain people more than others, and the police will just go and do as they institutionally are set to do. In 1920s Florida, a mob wiped an entire black town off the map. The law trundled up, interviewed a few people, the judge decried the violence, and then no prosecutions were levelled and everyone forgot about it for a few generations. Because the law wasn't there to represent black people. They were mostly worried it might inspire black people to burn down some white people's houses: that shit would be intolerable. People talked about "race war". And what really was race war but the fear white people would have of uppity blacks trying to take white people's stuff. When you start to view race relations in those terms: fear, hatred, conflict, that black people were stupid, degenerate, immoral apes, you can totally understand why blacks were seen as people to be guarded, controlled, and so on. And that's what the police were for. So, overpolicing, with more than its fair share of racism.