I have heard the claim being made (online, on various platforms) that the reason and/or circumstances for the founding of the police force in the United States was to protect the property of the property owning class (and this property includes slaves) and as such, the true role of police in the United States is not law enforcement per se, but protecting property, and law enforcement follows from that, as the law protects property as well.
How accurate is this claim? Is it in-line with any historical evidence on the matter?
Where can I learn more about the foundation of the police as they exist in the United States?
It's a little reductive, but it's a somewhat more accurate take than many. Boston, MA, began hiring police officers to work for the city in 1838, and formalized those officers as a municipal police department in 1854. Police officers had a slightly different role than the sheriff or marshal or constable of a town, who would serve predominantly as officers of the court, delivering court documents and summons, collecting fines or taxes (or tithes, if they were church officers, which wasn't uncommon in Europe), and organizing the patchwork of professional or semi-professional agents and volunteers that would do the bulk of the actual work.
In other words, while a constable/sheriff/marshal might arrest someone when they needed to, it was usually done with the cooperation of the local citizenry, who were expected to perform similar peace-keeping duties as part of their role in city militias, either formally or informally. Or, think of the cliché of the posse comitatus, embodied and sworn in as temporary officers of the court to hunt down and detain suspected criminals. These peace officers could be elected by citizens or appointed by civic leaders, and generally served limited terms for a salary, but sometimes the position was unpaid except for the officer keeping a portion of taxes and fines collected. There were no real firm rules on any of this, each town or city could organize its peace officers as they wished for the purposes needed. Some towns might have a fully paid marshal and many deputies, others might have a volunteer constable whose only income was a portion of fines. Others might not have a formalized peacekeeping officer at all. And some towns might allow for and elect a sheriff, and then dismiss the man and the role when the crisis passed!
This is generally how it worked for hundreds of years, with the officer of the peace, however named, serving as a responder to crime, not a preventer of it. It was expected that the capture, detainment, and punishment of criminals would be done largely with cooperation from the local community and ultimately to deliver them to the judgement of the court. Courts, of course, could be different and have different expectations, laws, and customs, but the customary role of the peace officer was to serve as an officer of the court in cooperation with the local community. The intensely localized element of this meant that certain trends manifested; you were far more likely to be arrested and punished for a crime if you were a non-local, and a lot of places (especially as Americans moved westward) had vagrancy laws, poor laws, black laws and other ordinances designed to discourage transient populations and workers from staying in town too long. Classic western cow towns like Abilene were periodically in violent crisis because the cattle men, on their long drives from Texas to the Abilene rail hub, would hang around in the saloons, spend their freshly earned money on booze, gambling, and partake in the local sex work establishments. Many of these men were young, non-local, and armed, and conflict between them, and between them and the citizens, led to the need for the kind of tough guy figure like Tom Smith or Wild Bill Hickok. But even eastern cities had a requirement for an officer of the peace willing to and skilled in the use of force to apprehend suspected criminals, or, at least, to cooperate with other agencies or forces in their apprehension of criminals. Two important elements here are private detective companies, who had their root in internal security forces of large scale industrial operations, especially those that dealt with mining, as theft prevention was an important facet of keeping things profitable, and after 1850, the local sheriff or marshal was, by federal law, obligated to cooperate with slave catchers following the Fugitive Slave Act.
Slave catchers were of course not new, and slave patrolling was a large element of militia organization in southern states, where the enslaved population tended to far outnumber the white population. While some of these men may have been semi-professional and act as a permanently embodied force, it was more often still done under a militia officer or other officer of the peace, to organize to apprehend escapees and to communicate information to nearby areas to do the same. While I believe that saying modern police forces owe their organization entirely to slave patrols is a little reductive, there is obviously some truth in that many municipal police forces were influenced by men who were experienced in southern slave patrolling, and whose knowledge of the infrastructure for communication and cooperation was very handy for urban policing. There is also another element that often goes unexamined: the fact that slave patrols were, like municipal police forces, interested not just in the apprehension of suspected criminals (or fugitive escapees), but were interested in preventing crime, and preventing escapes. More on that a little later!
Even in 1850, though, most cities lacked a formalized police service, relying instead on the more traditional peace officers. And it's important to point out that they generally weren't regarded as police, nor was the word often used for lawman. Police was a word associated with the military - Wild Bill Hickok served as a "police officer" in Kansas toward the end of the US Civil War, but the role described was more as a confidential informant or spy for the army, combined with working for other military posts in apprehending deserters and stolen government property - or for private agencies that worked with companies, and even they tended to use the word "detective" instead of "police."
So we can see this early customary system has all the elements of a modern police force, but it was distributed among quite a few different, often parallel, institutions and practices. The idea of a single office, much less individual officers, performing all of the duties described above, and moreover being paid a hefty salary for the purpose, among dozens of other similar officers, was an odd one, and clearly at least until the middle of the 19th century or so, unnecessary and unnecessarily expensive. There were already existing customary solutions to whatever problem of order arose.
So what changed by 1854?
Well, lots of things. Historians don't really have a solid, comprehensive consensus about most individual expressions of the second industrial revolution, but certainly the change in lifeways in the city and in the country and even in individual homes and families wrought by the rapid pace of industrialization had its effect on police forces. More and more rural people came to live in cities for wage work, alongside newcomer immigrants, and as a result cities grew to tremendous size more rapidly than these customary institutions could handle. The racial, national, and linguistic differences among these new urban populations also had silo effects; the Irish would live in one part of the city, blacks in another, the Polish in another, and they could be difficult for the (probably) white sheriff elected by white city voters to create the kind of reciprocal relationship between their agent of the peace and their community when the agent of the peace doesn't speak the same language, doesn't understand cultural practices, and in many cases would probably be openly hostile and critical to their needs. Furthermore, internal violence among immigrant groups was, in this system, impossible to respond to, because that kind of peacekeeping was absolutely dependent on community cooperation and trust.
Elements of this old customary system made it into later municipal police departments, as well as some elements of the rather newer system of corporate policing. But a city isn't a military post, and after 1865 there were no enslaved fugitives to apprehend, but many cities in the south still had formal military occupation during Reconstruction, and there were a few odd expressions of this. Texas, for instance, hired black officers in their state police during Reconstruction, and predominantly pursued racial crimes. It was loathed by many of the communities it was meant to police.
The big change wasn't necessarily in the name of the positions or the number and cost of the officers, it was in their role. The Texas State Police were part of an occupying force, and as such their efforts were more intensely punitive and preventative than old peace officers would be. But even in the north, the newer, formalized police forces started occupying a totally new role of active, assertive prevention of crime, and the harsh punishment of it. We don't know exactly why this happened as it did, but the increase in city populations, the patchwork of different cultural and linguistic neighborhoods, and the needs of industry to prevent theft and quell labor unrest added to the desire that municipal police forces change from a largely community-controlled (or at least influenced) model to one of what Foucault described as an institution of control, through concern with crime prevention rather than reaction.
This essentially meant that the people who predominantly influenced the behavior and purview of municipal police departments were those who wielded the most influence in a city: politicians, wealthy citizens, and industrial capitalists. So concern with "order" turned into cracking down on strikers, concern with apprehension of criminals turned into assertive prevention of crime by various means, and safeguarding private property meant safeguarding the property of the haves at the direct expense of the have-nots, particularly if the latter group was "not from 'round here," or spoke a different language and had a different cultural background. So while slave patrolling was an element of this, it wasn't the sole element of community protectionism and supremacy, as those existed previously in other forms.
Here is a relevant answer from /u/Takeoffdpantsnjaket about the origin of policing and slave patrols. The final sentence is a good summation,
Did the police come from slave patrols? Not really, because slave patrols and police both came from a desire to regulate society by force to keep the desired standard of those that were in control.