It is an interesting question. Read Crichton’s “Great Train Robbery”.
He deals not just with the question of the robbery itself but the early development of the police. He points out that early on the people hired to do the job were the ones who knew the most about crime. Criminals. The result, in not a few cases, was predictable. The people one turned to when victimized by crime were but a notch above the perpetrators.
Not to say that one had no alternative. The cry “Stop, THIEF” in those days precipitated a response from the public that could be excessive in proportion. The arrival of police in those days was more to protect the criminal in many instances.
Centuries of development of professional policing have helped greatly but has also reduced the public resistance to and acceptance of crime.
Notice as well that prisons long predated the invention of police. In fact, the LAST piece of our system of justice was the police.
Back in the 1970's in Albuquerque, New Mexico, the police went on strike at one point. Crime went DOWN. The citizens started patrolling their neighborhoods with their guns, and the criminals understood that the citizen patrols were not taking prisoners.
The people who call for abolishing the police refuse to understand that the result will be a return of lynching.