This is the understanding that many people miss. The Second Amendment only makes sense with this in mind. The right of the people to keep and bear arms is a check against tyranny from all levels of government.
Precisely.
A well controlled army being necessary to the security of a free country, the right of the people to keep and bear arms shall not be infringed.
You need the army to keep enemies out, you need to control it to keep it (and the government) from becoming the enemy within.
To that purpose the overwhelming number of private citizens, with their arms constitute a deterrent: therefore, the Right must be protected and left uninfringed.