The founders believed that they protected the government from someone taking over it by spreading the power out over 3 branches. The government would only turn on the people when someone managed to get control of all branches, which the founders were comfortable could not happen unless we, the people let it.
Most don't know that the constitution was not written until 1787. While we declared our independence from England in 1776, it took 11 years before an agreement could be made on the document that all states could ratify. Only 9 of the 13 colonies ratified the document by 1788, and it went into effect in 1789. It was not until 1790 when all 13 states ratified the document and it became the guiding law of the United States of America. Getting all the states to ratify the constitution was difficult, and the southern colonies were especially skeptical that the other states would not try to make the institution of slavery difficult to continue. The second amendment was not to protect the states from federal domination, it was to ensure that southern states could continue to run slave patrols, and was necessary to get these states to ratify the constitution. So the second amendment was about militia after all, but not about protecting ourselves against the government.
But the constitution does not define the only rights we can have, it lists the rights that cannot be denied to us. The founders never thought of keeping guns from everyone. In a colonial country that is ridiculous. But they did stop people from having guns in urban areas and cities as it was necessary to maintain public safety. All good common sense.
No one really knows what the founderss were thinking back then. All we have to go on was what they wrote and what they did. So to an extent, what the second amendment was really about is conjecture. But all of this makes perfect common sense. Problem is people from both sides don't want to admit it.