If the economy is so good, why are so many people struggling?

That’s the trillion-dollar question in politics and economics. The persistently widening gap between Wall Street and Main Street gave rise to the populists of both right and left.

On the right, the response to rising inequality and discontent is to blame outsiders, then get the government out of the way, and rely completely on the magic of a free market to create a just economy.

On the left, the reply is to democratize (that is, socialize) the economy by giving the public an effective voice to rewrite the rules — on taxes, antitrust, health care, housing, education, trade, the environment, employment and income — so that everyone may benefit from the nation’s bounty.

A new book by Columbia Law School professor Katharina Pistor, “The Code of Capital: How the Law Creates Wealth and Inequality,” argues that the “free market” isn’t so free. Capitalism didn’t spring fully formed, like Venus emerging from the sea. There is no primal capitalism to which we must return. There’s no pure form of capitalism forged by the invisible hand.

Instead, the capitalism we know was painstakingly built by the invisible pens of lawyers and judges that created over time broader and bolder property rights that are ultimately enforced by the power of the state.

With the help of the law and state power, capitalists have tilted the playing field, making sure that their property rights are respected and protected, she says.

Pistor shows exactly how the system was rigged.

“Rising inequality is the logical conclusion of a legal order that systematically privileges some holders’ assets, but not others,” Pistor says. “The logical result of such a system is rising inequality and the disenfranchisement of the democratic constituents.”

Coercive power of the state

The result is an economy and political system that serves only a few.

“Capital is inextricably linked to law and state power, because in its absence, the legal privileges capital enjoys would not be respected by others,” Pistor writes. Without the power of the state to enforce rights, the law of the jungle would prevail and a modern economy — with all of the marvelous things it has brought us — would be impossible.

With the right legal coding, any object, claim or idea can be transformed into capital. Spurred on by their clients, lawyers have pushed the boundaries of what can be considered capital over the centuries, using techniques updated from feudal times to code land, debt, stocks, bonds, derivatives, ideas, digital codes, genetics and even our emotions into capital that can be bought, sold, hoarded or converted into money.

The essence of capital is durable and transferrable property rights over assets. The legal coding in deeds, trusts, wills, debts, corporate charters, sales and user agreements, antitrust law, bankruptcy law, patent law, and thousand other documents determine who has the priority claims — in other words, who are the winners and who are the losers.

Political questions decided behind closed doors

These are not abstract concerns. With more of the world’s wealth accumulating in fewer hands, with capital expanding its domain to encompass more intangibles, including my thoughts, my movements, my DNA and even my facial expressions, the rights and privileges of capital are urgent matters for all of us. The capital controlled by Facebook FB, -0.85% , Alphabet GOOG, -0.70% GOOGL, -0.72% and Amazon AMZN, -0.12% consists mostly of trade secrets built on a Big Database of our behavior: what we search for, what we share, what we buy.

Who has the right to benefit from the bounty created by man and earth? Who owns the land — the people who’ve worked it for generations or the colonial interloper with a piece of paper signed by a distant king?

Who owns nature?

Who owns my body, my thoughts, my genes, my behavior? Who owns the store of human knowledge built over the centuries?

Who owns the future?

Who wins and who loses when things don’t work out as hoped?

Who gets bailed out and who doesn’t?

And, most importantly, who decides?

These are political questions, but for the most part they have been decided legally, mostly without the input or even the notice of the public. To say that the market will decide begs the question, for the market can only work if property rights are established.

The rich are getting richer. CBO

“All are equal before the law,” Pistor writes, “and yet, law often deals a better hand to some than to others.”

It is not to the strong, or the swift, or the wise that the victory belongs, but to the one with the best lawyer. That is the source, ultimately, of our economic inequality.

It’s no surprise that the big banks were able to privatize all the gains and socialize all the losses in the great boom and bust of the mid-2000s credit bubble. They wrote the contracts and the mortgages, and created the derivatives. Plus, they were too big to fail.

“Capital rules, and it rules by law,” Pistor writes. “It owes its capacity to create wealth to the modules of a legal code that is backed by state power; and its resilience in times of crisis can be attributed to a combination of legal asset-shielding devices and the state’s willingness to extend a helping hand to capital to preserve not only capitalism but social stability, and by implication, the state itself.”

Stateless capital

Capital gets the protection of the state, but capital itself is stateless, able to roam the globe to find the most favorable legal regime. Capitalists can use a threat to leave as a bargaining chip, or even as a business strategy, Pistor says.

As economist Albert Hirschman noted, members of organizations or societies — such as consumers, workers, companies, or citizens — have three options: exit, voice, or loyalty. If you don’t like something, you can raise your voice and try to change things, or you can leave. But under our form of undemocratic capitalism, few have a powerful voice, especially not consumers or workers.

And the threat of exit is blocked for most people (as Hirschman, a refugee from the Nazis, well knew). They say “love it or leave it,” but mere mortals cannot move at will, as capital can. People need passports, visas, a country’s version of the U.S. green card. So most people are blocked from either having a voice or leaving, which leaves them with only one choice: Blind and unquestioned loyalty.

Most of us cannot roam around the globe to seek an economic system that gives us a voice. We are stuck as consumers, as workers, and as citizens. And that is the appeal of populism. It promises to give us our voice back.

But the populists of the right have misdiagnosed the illness. “Blaming other states, supranational organizations, such as the European Union, and most conveniently, natural persons with no or only a foreign passport, is hardly a solution when in fact the real winners are hiding in plain sight in their own midst and use the law to fashion their capital,” Pistor writes.

For democracy to prevail, the people must regain some control over the law to reset the balance of power in our economy, she says. Most likely it won’t be a revolution that does it, but a slow, incremental whittling away of capital’s advantages. Exactly the way it was created.

Capitalism won’t be destroyed by this process, just transformed into a system that benefits all instead of the few.

Maybe we could call it “democratic capitalism.”