Picture yourself loading a cart at dawn. The river fair is breaking up around you, the landlord's nephew has just announced a rent increase you consider fraudulent, and your entire legal remedy amounts to the look on his face when you don't come back next season. You leave. The dispute evaporates. And the settlement, stripped of any reason to build something that outlasts you, stays exactly as legally shallow as it was the day you arrived.

The walled city sorted this out. Not perfectly, not always fairly, but durably. The reason is less romantic than it sounds.

The Wall Is Not About Defense

The conventional explanation runs like this: walls kept invaders out, which gave residents confidence to invest, which encouraged stable institutions. There is something to it. But it flatters the wall too much, and it misses the core mechanism entirely.

Consider two medieval towns sitting fifty miles apart. One is walled, with perhaps four thousand residents behind dressed stone. The other is an open river settlement with twice the commercial traffic: grain merchants, wool traders, itinerant craftsmen cycling through on seasonal contracts. By any measure of raw economic activity, the open settlement wins. More goods, more transactions, more money changing hands.

And yet, look at the documentary record two centuries later. The walled town is far more likely to have surviving title registers, enforceable lease structures, and precedent-based inheritance rules. The open settlement either absorbed into a larger jurisdiction or dissolved into contested ownership claims that made sustained investment impossible.

The wall changed one thing above everything else: the cost of leaving.

Skin in the Ground

In an open settlement, a merchant who loses a property dispute can simply go. Load the cart, follow the river, find another market town three days east. The loss stings, but his social identity, his credit relationships, even his physical safety are portable. Mobility is his insurance policy.

Inside a wall, that calculation inverts. The wall does not trap people literally, but it concentrates them. It creates a defined population with shared infrastructure: the same well, the same grain store, the same guild hall. Reputation is local and sticky. A man who cheats on a property deal inside the wall cannot easily outrun the story. His neighbors know his face. His children will want apprenticeships. His widow will need the goodwill of the same families he might consider defrauding today.

This is what economists sometimes call commitment through illiquidity. The walled resident's assets are physically harder to move, his house is not a tent, his orchard takes fifteen years to mature, and his investment in local relationships is real and non-transferable. The phrase that captures it more plainly is skin in the ground, which has the virtue of saying exactly what it means.

So when a dispute arises, both parties have a strong incentive to accept formal resolution rather than defect. When both parties repeatedly accept formal resolution, you accumulate something: precedent. Precedent calcifies into custom. Custom gets written down when a literate clerk arrives and the community decides the cost is worth it. Written custom becomes enforceable law.

It compounds like interest. Slowly, then all at once.

The Open Port Problem

None of this means open settlements were lawless. Many had sophisticated commercial codes, especially for contracts: bill-of-lading law, bills of exchange, the lex mercatoria that governed medieval European trade fairs. But notice what those codes specialized in. They governed transactions, not property. They were built for people who would be gone by Thursday.

Take two merchants, call them Albrecht and Caterina, who both arrive at the same Flemish river fair in the same season and rent adjacent warehouse space from the same local landlord. Albrecht is from Cologne and visits twice a year. Caterina is from Bruges and comes every month. When the landlord dies and his nephew claims the warehouse rent should double, their responses diverge sharply. Albrecht can find another fair. He absorbs the cost as friction. Caterina, who has built her entire distribution network around that location, has to fight. She appeals to the guild, calls witnesses, invokes prior agreements.

Caterina is behaving like a walled-city resident even though she lives in an open one, because her investment pattern has made her functionally immobile. The point is not the wall itself. The point is what the wall reliably produced: a population whose investment patterns gave them a reason to build institutions that would outlast any single dispute.

Open settlements without that sticky population tended to produce transaction law that was sophisticated but shallow-rooted. When the fair moved, the law moved with the traders, carried in their heads and applied wherever they next gathered. Adaptable, yes. Durable in a single place, no.

What People Assume About Volume

The persistent mistake is to assume that more commercial activity automatically produces stronger legal infrastructure. Volume creates demand for law, certainly. Demand does not guarantee supply, and it especially does not guarantee the kind of supply that persists across generations.

High-volume open settlements often attracted external legal authority instead of generating their own. A powerful lord, a distant king, a guild confederation would step in to impose order because the local population lacked the collective staying power to build it themselves. That imposed order could be effective, sometimes very effective. But it was borrowed, not owned. When the external authority weakened or redirected its attention, the local legal fabric frayed quickly.

The walled city, building from within, produced something closer to ownership of the law. Citizens had argued over it, paid for its enforcement, modified it through petition. They had standing, in both the legal and the emotional sense. And here is the question worth sitting with: if the legitimacy of any legal system depends partly on whether the people subject to it had a hand in shaping it, what does that say about legal frameworks imposed on high-turnover populations from outside?

The institutions were theirs to defend. That distinction matters more than most institutional economists are willing to admit, because it means the quality of law is not just a function of drafting or enforcement capacity. It is a function of who has decided they are staying.

There is a modern corollary that urban planners and development economists keep rediscovering: informal settlements with stable, long-term residents often develop more coherent property norms than formally zoned areas with high population turnover. The mechanism is the same one the wall enforced by geography.

Staying is the condition. Everything else follows from staying.

The wall was, in the end, a forcing function for commitment. Not a guarantee of justice, not an engine of prosperity on its own terms. Just a way of ensuring that when your neighbor wronged you, you both had to live with whatever came next. Shared vulnerability, it turns out, is the unglamorous foundation on which durable law is actually built. Anyone who has tried to impose legal order on a population with one foot out the door already knows this, even if they lack a medieval town wall to make the point for them.