How America came to be
The first try did not work. The second one is still running.
The first American government was the Articles of Confederation, and it was too weak to function: Congress could ask the states for money but not require it, and could not regulate trade between them. In the summer of 1787 delegates met in Philadelphia, officially to fix the Articles. They wrote something new instead.
The central problem was that big states and small states both wanted to win. The answer, the Great Compromise, was to have it both ways: a House sized by population and a Senate with two seats for every state regardless. That argument is why Congress has two chambers.
They also split the government three ways — a Congress to make law, a President to carry it out, courts to judge it — and gave each one ways to block the others. It is deliberately slow. It was designed by people who had just fought a war against a government that could act quickly and did not have to ask.
It was signed on 17 September 1787 by thirty-nine delegates, and it was not law until nine states ratified it, which happened in June 1788. Several states only agreed on the understanding that a bill of rights would be added at once. It was: ten amendments, ratified in 1791.