Most Americans are law abiding. How does this happen? Most everyone knows what the law is, and believe it to be fair, and they think of themselves as decent citizens and so they obey it. They obey the obvious bits drawn from the ten commandments and they obey the not so obvious bits like income tax. American's willingness to do the right thing, obey the law and pay their taxes is unusual in this world, and a great source of national strength.
In short, the law is what the citizens believe it to be, and those beliefs cannot be easily changed. Legislatures or courts cannot pass new laws and have them obeyed, unless those laws are acceptable to the citizens. Prohibition is the classic example of an unpopular law being defied by the ordinary citizens.
Most Americans believe the Constitution gives them the right to own guns. In fact, the written Constitution is pretty clear on the subject. In the first century of the country's existence, this right was unquestioned. Sometime in the second century an attempt to revoke this right was made, and learned lawyers opined that the plain words of the second amendment meant the citizens only had a right to join the National Guard, and not a right to have a piece in the bedside table.
The citizens never bought into this interpretation (distortion) of the law, and continued to believe in the right of private ownership of firearms. Yesterday the Supreme Court finally ruled that the second amendment means what it says and citizens do have an "individual right" of gun ownership. This is an important ruling because it brings the "official" law into compliance with the real law, the law that the citizens believe in and obey. That is a good thing.