Let me explain:
The United States government is composed of 3 branches: Executive (Presidential), Legislative (Congress), and Judiciary (Supreme Court). The Legislative branch is what this relates to, however. The Legislative branch is divided into 2 houses, the House and the Senate. If a bill is proposed, both the House and the Senate vote on whether to pass the bill. If it passes through both the House and the Senate, it goes to the president. The president can decide to either sign or veto the bill. If it is vetoed, it can go back to congress where if it passes both houses with 2/3rds of the congress voting in favor of the bill, the veto is overridden.
Now that you have a basic understanding of how laws are passed, let me explain how this relates to how there are 50 states.
Each state has 2 senators and few representatives in the house. The exact amount of representatives are based on population per area. There are 100 senators and 435 representatives in total. There are roughly an equal amount of 'red' states and 'blue' states (though the majority of area is red, but I digress). Since there are 50 states, this allows there to be a near-balance so total war doesn't break out.
God bless america (see attached image)