The Second Amendment was Ratified to Preserve Slavery
In the beginning, there were the militias. In the South, they were also called the "slave patrols," and they were regulated by the states.
In Georgia, for example, a generation before the American Revolution, laws were passed in 1755 and 1757 that required all plantation owners or their male white employees to be members of the Georgia Militia, and for those armed militia members to make monthly inspections of the quarters of all slaves in the state. The law defined which counties had which armed militias and even required armed militia members to keep a keen eye out for slaves who may be planning uprisings.
As Dr. Carl T. Bogus wrote for the University of California Law Review in 1998, "The Georgia statutes required patrols, under the direction of commissioned militia officers, to examine every plantation each month and authorized them to search 'all Negro Houses for offensive Weapons and Ammunition' and to apprehend and give twenty lashes to any slave found outside plantation grounds."
It's the answer to the question raised by the character played by Leonardo DiCaprio in Django Unchained when he asks, "Why don't they just rise up and kill the whites?" If the movie were real, it would have been a purely rhetorical question, because every southerner of the era knew the simple answer: Well regulated militias kept the slaves in chains.
Sally E. Haden, in her book Slave Patrols: Law and Violence in Virginia and the Carolinas, notes that, "Although eligibility for the Militia seemed all-encompassing, not every middle-aged white male Virginian or Carolinian became a slave patroller." There were exemptions so "men in critical professions" like judges, legislators and students could stay at their work. Generally, though, she documents how most southern men between ages 18 and 45 - including physicians and ministers - had to serve on slave patrol in the militia at one time or another in their lives.
And slave rebellions were keeping the slave patrols busy.
By the time the Constitution was ratified, hundreds of substantial slave uprisings had occurred across the South. Blacks outnumbered whites in large areas, and the state militias were used to both prevent and to put down slave uprisings. As Dr. Bogus points out, slavery can only exist in the context of a police state, and the enforcement of that police state was the explicit job of the militias....
Never a good idea to forget your history.