The following history behind the Second Amendment to the United States Constitution I first learned in high school more than 50 years ago.
The General Court (legislature) of Massachusetts Bay Colony established the precedent for the private and public ownership of weapons by first requiring all adult males to possess a firearm and following that required town organizations to arm and maintain a company of militia. Even though town organizations had ultimate responsibility for arming the militia, the 1643 Confederation of New England Colonies shifted the responsibility for arming of the militia to the General Courts. That lasted until 1775, when the Continental Congress pre-empted their authority. This authority was not returned until the adoption of the Second Amendment in 1791.
Because of property qualifications, the constitutional conventions were in the hands of the wealthy few, leaving the mass of the American people unrepresented. This gave rise to the demand for a Bill of Rights. Considering the fact that the colonial/provincial legislature armed the militia before being pre-empted by the Continental Congress, the Second Amendment was nothing more than returning responsibility of arming the militia back to the legislatures.