WELL REGULATED MILITIAS
Militias were the American colonies militaries before the Revolution. In 1776 the Continental Army was formed to fight the Revolution. In 1789, the Articles of Confederation were superseded by the US Constitution. The Continental Army disbanded with the end of hostilities.
The Second Amendment was written before the standing army. Many of signers did not want a standing army, and preferred militias, Madison and George Mason, Virginians, for example. It reads: A well regulated militia, being necessary to the security of a free State, the right of the people to keep and bear arms shall not be infringed.
In 1789, militias were suspect, Hamilton argued, that the ability to train a whole militia made a select corps inevitable. The first standing army, the Legion of the US was established between June and November of 1792, under Anthony Wayne, to fight Tecumsa and his Indian Confederation.
In 1802, the federal military academy at West Point rectified the failure of irregular training inherent in the States based militia system. John Adams discussed militias in 1823, and found a failure to train men in State militias, and a failure to train officers as well.
Since the Militia Act of 1903, many States have created and maintained a reserve military force known as State defense forces, or State guards.
None of this has anything to do with the right to own an assault rifle, or a machine gun. The right to bear arms in well regulated militias has nothing to do with individuals owning weapons of war and using them outside of a well regulated militia.
The subject of the Second Amendment is the right to bear arms in militias regulated by States, or joining the Federal National Guards. The right to bear arms in militias run by State governments, or the Federal Government, shall not be infringed. The maniacs with assault rifles killing their fellow citizens are not bearing arms in well regulated militias.