Security and the institutions of medieval republics
I have written about how the productivity of property, and the institutions associated with that property, have tended to be greatly improved when that property was more secure from military and poor quality political intervention (and how these two interventions were often related). Societies dominated by different kinds of property thus have formed different kinds of political and legal structures. For example, modern states whose economies are dominated by the extraction of oil and other minerals tend to have strong governments, and correspondingly less freedom and democracy, especially when (as now) the prices of those mineral deposits are high, probably because mineral extraction tends to be dominated by up-front rather than operational costs, making it easy for governments to expropriate the bulk of the surplus.
Although farming dominated most economies until modern times, medieval city republics produced a large number of crucial innovations and had a profound influence on the modern world. Examples included Venice, Genoa, and the Hanseatic League. These republics were focused on cities and their economies were dominated by goods (primarily their storage and transport, but also manufacturing) rather than by farming. As a result, they evolved a set of unique institutions and a unique form of government, the corporate republic. These republics were generally focused on cities that secured their goods, markets, and persons on islands or behind steep mountains. These medieval republics developed a wide variety of institutional innovations, such as insurance and the corporate republican form of government, which are crucial to our modern era.
Illustrations: Genoa (top) and Venice (above), foci of the two most extensive, powerful, and innovative city republics of medieval Europe.