Note that those states operate under a common national government. That is why it works, and also why international free trade requires you to give up sovereignty to governing bodies like the WTO.
I can explain that if you want...
No, it 'works' because of comparative advantage and government isn't getting in the way of me driving across the border and buying what I want. When a State like California imposes upon it's citizens and businesses excessive taxes, it's not allowed to tax goods at the State border from Nevada, or anywhere else that doesn't have the same dumb regulations. They're not allowed to put up a Berlin Wall and try to keep people in either.
WTO is managed trade, ie communism, it's not Free Trade.