The Second Amendment applied to the maintenance of well-regulated militias.
The militias were not for protection against the government.
They were to protect the government and the Constitution, because the Constitution prohibited a standing army.
The Founding Fathers were frightened by a standing army, because they feared coups.
Without a standing army, the only protection the people and the government had were militias.
The U. S. Constitution, Article 1, Section 8, states
Note that there could be a permanent navy, but not a standing army.
Note also the Constitution explicitly states what militias do: they make sure the laws are followed, suppress insurrections and repel invasions.
This was a lesson learned after Shays Rebellion of 1786-1787 and The Whiskey Rebellion 1791–1794.
The Militia Act of 1792 also explicitly directs the president’s use of militias. The Militia Act of 1792
The Constitution made sure that there was nothing to fear from the Federal government, because there was no standing army.
They feared insurrection and invasions of all sorts.
The militias were empowered by the Constitution to protect against these in the absence of a U.S. army.
Every single speaker in the U.S. House of Representatives who commented on the Second Amendment before its ratification spoke only about militias.
That being said, the Founding Fathers seemed to think that guns and militia service were good for character building.
They certainly didn’t want to ban them. On the contrary, gun ownership and militia membership were required.
The aforementioned Militia Act of 1792 stated:
However, the states had many laws regulating guns from the earliest days of the founding of America until the present day.
Not only slaves and free blacks, but law-abiding white men who refused to swear loyalty to the Revolution were prohibited from owning guns.
Even Dodge City, Kansas in the 1870’s prohibited weapons from being carried. That law wasn’t very effective.
The U.S. Constitution and subsequent laws provided for militias to protect the government, while regulating guns.
Guns were integral to the American experience, as every white male between 18 and 45 was required to own a gun and serve in the militia.
Guns could be and were regulated.
It is difficult to know with certainty how the Founding Fathers would react to a number of things as they are today, including the fact that we have an incredibly powerful standing army and that we are awash in handguns and weapons that have no relationship to militias.
For what it’s worth, my opinion is that at this time gun ownership is fully ingrained in our laws and experience.
The states should be able to regulate them as they see fit. That is the law as it is now.
To change the law will require a Constitutional Amendment, which is not likely any time in the foreseeable future.