I'm going to say that everyone is so far is basically wrong, especially the accepted answer.
Been studying this exact question of late, focusing on Venice and Golden Age of the Netherlands which also coincided with a 80 year long war to the knife war of independence against the Habsburg Spain.
What's really interesting is that trading cities grow not only rich, but militarily powerful vastly out of scale with their populations as well as ALWAYS becomes the centers of arts, sciences, law, religious freedom and evolving human rights in their eras and regions.
Both Venice and the Netherlands started out with vast resources of... mud, murderous neighbors and a sea that liked to try vacation in the mountains occasionally. It was material that made them wealthy, it was human capital.
Meritocracy and voluntary association...that's what makes them rich.
The key factor in trade is the trader has to leave his own political jurisdiction, where he can pull the old, "Don't you know who my daddy is?" bit and instead travel far away where no one give a bleep who or what the trader is. Long distance travel, especially sea travel is crucial. Separates daddies boys from the orphaned but skilled.
Either someone can captain a ship way over the horizon, puzzle out the language and customs, negotiate a deal and then make it back home with a profit...
….or they can't. If they can't, they drop out of the game.
Even back home, the powerful find it increasingly difficult to use privilege to get their way because again, far away strangers, the sea and deserts don't care just because you come from a nobel family with lots of patronage and any of the three will kill you if you make a slip.
Pretty soon a meritocratic class of traders, artisans and technicians (like skilled sailors) become vitally import. This in turn causes a relative decentralization of political power, which leads to more meritocratic promotion, more social cohesion and overall better decision making.
Investment becomes utterly voluntary as well. Resources flow those who have proven they get the job done whether that means long distance trading, building dykes or waging a private guerre de course against a world superpower that is literally minting most of the money in the world. People learn to bribe, weeddle, cajole but they can never force. In the end, it is empirical success that chooses projects, products and the people who manage them.
Now, compare the same process in the competitors of the Netherlands or Venice. Leadership selection? Mostly by birth rank, then patronage, then bullying or outright threats. Project selection? Almost entirely political with the focus on image of the leadership that anything else because, surprise, its all paid for by money extracted literally at knife point. If things implode, well the king is not going to get blamed is he?
It is the development of vast human capital on all levels that makes trading cities rich and powerful. They can literally start with nothing, Venice certainly did, but using proven merit to advance individuals and interest and by preferring voluntary association and consensus, they became staggeringly rich and powerful.
But it's not just trading cities. Every sudden Empire in history, Athens, Rome, Ghengis Kahn, the early Muslim etc all also grew orders of magnitude more powerful than than their competitors merely by using merit selection. Athens was forced into democracy and merit selection by the pressure of the Persians. Rome by the Kings and the Gauls. Ghengis Kahn rose from two-bit eternally feuding step nomad riding deranged shetland ponies to the Emperor of a 6th of the Earth's surface, when he killed his best childhood friend so he could implement leadership selection by merit. Mohammad and the first few generations of his successors, managed the same trick, allowing a bunch of desert raiders to wipe out the Persian and conquer half of Christendom, India and Eastern Africa.
Merit, empirically selected, is all it takes. Doesn't take resources of any kind, doesn't take a large population, doesn't take good luck. Just merit selection.
Merit lets a people turn literal mud and flood into wealth and empire.
Of course, in the end that very wealth and power does them end. Succeeding generations take everything for granted, forget merit and start playing the usual games of protection, privilege and patronage. People get ahead by gaming the system, sucking and threatening.
It's still going on. Bonus points if you chart the rise and fall of different economic zones in the US and correlate them with particular strongly anti-mericratic organizations and political ideologies.