It is a confluence of the watch groups in the northern colonies and the slave patrols in the southern colonies.
The slave patrols of the south are the first version of police organizations as we know them today.
Most law enforcement, particularly in the south, were white patrollers watching, catching, beating, enforcing curfews, controlling movement and behavior, preventing organized resistance, and terrorizing enslaved people.
We can also see parallels between the roles and responsibilities of the legal patrols and watch groups of that time with the legal roles and responsibilities of law enforcement today.
As it was during slavery, and still is today, the primary role of law enforcement is to watch, catch, beat, enforce curfews, control movement and behavior, prevent organized resistance and terrorize black and brown people.