Initially, many of the southern states used their militias to back up the police (slave catchers). Not in the day-to-day activities but in putting down riots and such. At the same time, if it were white people rioting, the same militias probably would have been used on them. How the states used their militias was a product of the time and the culture. We use police and army reserves to put down riots in the world today and this is a direct violation of the constitution. The US military is significantly involved in civilian law today. (see below)
Anti 2nd Amendment advocates often argue that the amendment was crafted so that slave owners could control any outburst, riot, on their plantations. It’s a wild assertion with no actual evidence supporting the assertion. (While that may have been one benefit in the minds of the Southerners seeing to ratify the Amendment, it was not an argument put forward. People do have their own agendas.)
Congress in 1981 to enact legislation providing for military cooperation with civilian law enforcement officials. Although recognizing the Posse Comitatus restrictions, the law opens the door for extensive use of the military in civilian law enforcement.
The Department of Defense has developed directives to provide types of direct and indirect assistance to civilian law enforcement agencies. Currently, the military collects information and uses military equipment to track violators of drug laws. This gets us back to civil forfeiture and the reason behind government involvement. (That’s what they officially say they are doing.) LOL
TMI - It’s a mess. Like most of politics.