The Second Amendment to the U.S. Constitution calls for:
"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."
The right of militias, which were made up of individuals in towns all over the thirteen colonies, to own guns makes a lot of sense when understood in historical context. The American Continental Army which fought valiantly for independence against Britain, an overwhelming military power, depended on militias to train recruits and to insure that they owned weapons.
For example, when Colonel John Paterson (later General Paterson) received notice that the first shots of the revolution had been fired, he summoned his Berkshire Massachusetts militia . The men secured their rifles, mounted their horses, and headed for Boston. Although they made the trip in record time they missed the battles of Lexington and Concord but later fought in many other major battles , including Bunker Hill, the crossing of the Delaware with George Washington for the successful surprise attack on Hessian forces loyal to the British in Trenton, New Jersey, and the victory in the battle of Saratoga, which was a turning point in the war.
If Paterson's militia, or other militias, had not brought their own weapons to the Continental Army they would have been unprepared for battle and would thus have been of much diminished military value.
Especially at the beginning of the war for independence the Continental Army did not have a highly organized military infrastructure with sufficient supplies of weapons, uniforms, or provisions to match the British. That's why soldiers in the Continental Army were often expected to bring their own guns: "Standard issue was unheard of." The most preferred combat weapons were the single-shot rifle and single-shot musket Here's a vivid description of frontier American volunteers joining the battle:
"Of all the guns of the Revolution, popular tradition has cloaked the rifle with an almost magical and glamorous quality, describing it sometimes as 'the gun that made victory certain in the American Revolution.' The first companies of frontier riflemen to be raised, dressed as they were in buckskin hunting shirts, with awesome knives and tomahawks in their belts, created a sensation as they proceed from Pennsylvania and Virginia to join the military units and state militia laying siege to the British in the Massachusetts capital."
Nevertheless, the Continental Army often lacked the weapons and supplies to effectively face off with the British:
"A shortage of arms was chronic. Little more than a year after the outbreak of the war, one quarter of the Continental Army had no guns."
The North Carolina Museum of History describes a prominent incident in which the lack of weapons and supplies thwarted a military opportunity:
"Often it was hard to get supplies, and the shortages hurt the war effort. The North Carolina troops planned an expedition to Georgia and Florida, but it failed for lack of supplies. One officer defended General Robert Howe of North Carolina, stating that the public was throwing a thousand reflections on the General and the army for not marching to attack the enemy and storm lines, without provisions and without ammunition."
Keep in mind that with the signing of the Paris Treaty in 1783, which brought an end to the revolutionary war, the thirteen colonies plus the land east of the Mississippi, ceded to America by the British in the Paris treaty, only constituted about a third of the present United States in North America. And that was still the landscape of America when the Constitution was ratified in 1788 and also when the first ten amendments were approved by the states in 1791. Potentially hostile armies of France, Spain, and Mexico surrounded America's western and southern borders. And the British occupied Canada and the far west, in what is now Oregon and Washington.
With dangers looming on
all the borders, it's understandable that the Founding Fathers would include
the Second Amendment to insure that militias would have sufficient weapons if
they were called up for national defense. The amendment was particularly vital
since following the revolution, "the United States reduced its standing
army to only a handful of men, entrusting the state militias with the nation's
defense." After the disbanding of the Continental
Army in 1783, the United States army wasn't established until 1796, five years after the adoption of the Second Amendment. This
means that for at least that five year period the United States was totally
dependent on State militias for national defense. No wonder, therefore, that
the Second Amendment called for armed militias.