History
“The Second Amendment to the Constitution of the United States, adopted in 1791 as part of the Bill of Rights, that provided a constitutional check on congressional power under Article I Section 8 to organize, arm, and discipline the federal militia."
Simplified
The Second Amendment was created as a quote un-quote back up plan in case the government (congress) went into anarchy, as well as reason to create a state militia, which is the National Guard.