It gets complicated because the Supreme Court of the United States has determined in the past that rights are not absolute, and therefore subject to "reasonable restriction" (or "regulation", can't remember the exact wording).
Problem being we haven't had the courts determine what "reasonable" is in terms of the 2nd Amendment, which leaves what is "reasonable" up to legislators representing their constituents. That obviously results in a wide swing between what is reasonable depending on the constituents.
There also comes the issue that we have two sovereign governments in the US.....the federal government, and the government of a given state. Each government operates under their own constitution that usually are pretty close but may have some differences. The 14th Amendment (establishing civil rights) "incorporated" the US Constitutional Amendments onto states, meaning they're binding to the state government as well. However, the Supreme Court of the United States adopted a doctrine of "selective incorporation", and not absolute: the result being that only certain amendments (and only certain parts of those amendments) are incorporated. It wasn't even until 2010 that the Supreme Court affirmed that the 2nd Amendment is fully incorporated by the 14th Amendment. Until then, a state could argue they didn't actually have to follow the 2nd Amendment as the Constitution only required the government of the United States to follow the 2nd Amendment....not individual states.
It's very convoluted, and hopefully that helped. Also, I hope that my layman's understanding and explanation didn't make @
joshs slam his face into a table.