The Origins of Virtue
Government, law, justice and politics are not only far more recently developed than trade, but they follow where trade leads. Indeed, just as this is true for hunter-gatherers, so it now appears to have been true for medieval merchants as well. Modern commercial law was invented and enforced not by governments, but by merchants themselves. Only later did governments try to take it over, and with mostly disastrous results.
Go back to eleventh-century Europe. Agricultural productivity had improved thanks to various innovations; the result was that surplus labour had left the land and moved to the towns to work on the manufacture of goods other than food; exchanging these goods made by the artisans for the food grown by the farmers benefited both, and gave a further spin to the engine of prosperity. For the first time the volume of trade created a new class of prosperous and professional merchants. As the economic expansion continued some of these merchants began to look abroad for opportunities to exploit comparative advantages between countries. But a merchant in a foreign country had no recourse to his sovereign if cheated and no confidence that the same standards applied there as at home. So merchants began to get together and formulate the rules of the game. The lex mercatoria was born. It had no recognition from the state. It was voluntarily produced, voluntarily adjudicated and voluntarily enforced. It was like the customs of a club.
It evolved. Good customs that worked, and good ways of settling disputes, drove out bad by natural selection. By the mid twelfth century, merchants travelling abroad had substantial protection in disputes with local merchants under the merchant law.