I think this is a good summary: https://constitutioncenter.org/interact ... interps/99
Very few people talked about the Second Amendment or asked the questions we now ask until fairly recently because these were not the questions in the minds of the Founders. We read our own issues back into their time.
The Founders didn't think the United States should have a standing army. Instead, there should be state militias that would be ready to respond in case of an emergency. An army should be raised only when needed to fight a foreign enemy, then disbanded. So the right of individual states to have militias, unimpeded by the Federal government, was the main issue. And of course, state and local governments were not bound by the Second Amendment at all, it applied only to the Federal government.
That's the context for the Second Amendment. In this context:
This massive shift of power from the states to the federal government generated one of the chief objections to the proposed Constitution. Anti-Federalists argued that the proposed Constitution would take from the states their principal means of defense against federal usurpation. The Federalists responded that fears of federal oppression were overblown, in part because the American people were armed and would be almost impossible to subdue through military force.
Implicit in the debate between Federalists and Anti-Federalists were two shared assumptions. First, that the proposed new Constitution gave the federal government almost total legal authority over the army and militia. Second, that the federal government should not have any authority at all to disarm the citizenry. They disagreed only about whether an armed populace could adequately deter federal oppression.
The Second Amendment conceded nothing to the Anti-Federalists’ desire to sharply curtail the military power of the federal government, which would have required substantial changes in the original Constitution. Yet the Amendment was easily accepted because of widespread agreement that the federal government should not have the power to infringe the right of the people to keep and bear arms, any more than it should have the power to abridge the freedom of speech or prohibit the free exercise of religion.