Seems pretty clear in the context of the revolutionary war that the purpose of the 2A was to protect the ability of citizens, or more specifically militias, to overthrow a tyrannical government.
Interestingly this has actually happened once in the USA since the revolutionary war, the Battle of Athens in Tennessee in 1946 (1)! Small scale sure but it worked as intended.
1: https://www.libertarianism.org/articles/battle-athens-obscur...