The Second Amendment protects my right to keep and bear arms. The exact same arms as those wielded by the military.
When the Second Amendment was written, the usual means of fighting was to stand in lines and shoot at each other. Some talk about how dumb this was, ask why rifles weren't used, but given the technology of the time, it was the only way to conduct war.
The rifles of the time worked well as a weapon of asymmetric war, ideal for sniping, ambushes, and hit and run attacks, but it failed as a weapon of regular war. This was because the only ammunition available to anyone of the time was the lead ball. It wasn't until 1847 that the first successful
real bullet was introduced. Until then, the only way for rifles to be effective was to force a lead ball slightly larger than the bore of the rifle, to engage the rifling, making it impossible to load a rifle quickly, allowing early riflemen to be easily overran and slaughtered by cavalry or advancing musketeers should they try to hold a battlefield.
The musket, on the other hand, was specifically designed as a weapon of war. Because it was a smooth-bore firearm, it could be loaded quickly (although at the expense of accuracy). This made musketeers harder to overrun, while forcing them to engage at much shorter distances.