“If the country be invaded, a state may go to war, but cannot suppress insurrections. If there should happen an insurrection of slaves, the country cannot be said to be invaded. They cannot, therefore, suppress it without the interposition of Congress."
Patrick Henry, at the Virginia ratification convention, arguing against federal control of state militias. George Mason offered similar views. Fellow Virginian James Madison then penned 2A, borrowing some language not coincidentally from George Mason's Virginia Declaration of Rights. No hate mongering, other states did indeed agree with the preference for state control of militias without slavery as an issue, like Massachusetts.
Slavery was not accepted "as is," many delegates to the Constitutional Convention spoke out against it, eventually accepting it as being outside the scope of their mission, to avoid failure. No need to whitewash it, multiple constituencies agreed the people needed to be armed.
Prevention, due to heavy policing and GUNS, not because America ignored what was going on elsewhere. And who knows how much wasn't documented. Regardless, I wasn't claiming this was the primary reason for gun ownership, I just lumped it together with native and foreign threats, all requiring an armed populace.