Have you noticed that the world is on fire?

Crowds are chanting “Death to Khamenei” in Iran while the regime kills them en masse and shuts down the internet. Throngs are marching to preserve democratic rights in Hong Kong; Warsaw, Poland; Budapest, Hungary; Istanbul; and Moscow. The masses are angry in Pakistan, Indonesia and Saudi Arabia and toppling leaders in Lebanon and Bolivia.

This is the most widespread surge in global civic unrest since 1989. It’s a story 10 times bigger than impeachment, although the two are related.

The seeds of today’s unrest were planted in those events of 30 years ago — the fall of the Soviet Union, the spread of globalization and all the rest. That was the heyday of liberal democratic capitalism, free market fundamentalism, the end of history.

We all know now what many of us didn’t appreciate then: Globalized democratic capitalism was going to spark a backlash. It led to growing economic and cultural clashes between the educated urbanites, who thrived, and the rural masses, who were left behind. It was too spiritually thin, too cosmopolitan and deracinated. People felt that their national cultures were being ripped away from them.

The populist backlash came in different forms in different parts of the world. In Central and Eastern Europe it came in the form of nationalist strongmen — Victor Orban, Vladimir Putin, the Law and Justice party in Poland. In Latin America it came in the form of the Pink Tide — a group of left-wing economic populists like Hugo Chávez and Nicolás Maduro. In the Anglosphere it was white ethnic nationalism of Donald Trump and Brexit. In the Middle East it was Muslim fundamentalism. In China it was the increasing authoritarianism of Xi Jinping. In India it was the Hindu nationalism of Narendra Modi.

In places, the populist wave is still rising. The yellow vest movement in France and the protests in Chile are led by those who feel economically left behind. But it’s also clear that when in power the populists can’t deliver goods. So now in many places we’re seeing a revolt against the revolt, urban middle-class uprisings against the populists themselves.

The core problem is economic. Populist economic policies of left and right destroy growth. Venezuela is an economic disaster. In Mexico the left-wing populist policies of Andrés Manuel López Obrador have brought growth to a halt. The International Monetary Fund projects Latin American growth could fall to 0.2%.

Lebanon is creating only 3,000 jobs a year, when it needs at least 20,000. Meanwhile, debt has soared. Trump’s trade war has lowered American economic dynamism. Xi has walked away from market reforms and ushered in an economic slowdown. Under tax-hiking populist leader Imran Khan in Pakistan, car sales fell 39% in the latest quarter.

All across the world, members of the new middle classes feel trapped and abandoned. As Fareed Zakaria noted recently, the IMF sees a world economy that is in a “synchronized slowdown” and growing at “its slowest pace since the global financial crisis.”

The second thing the populists have brought is corruption. Trump’s quid pro quo attempt with Ukraine is of a piece with the corrupt practices ushered in by populists all around the world. They vowed to smash the rules, but it turns out it was mostly for self-enrichment and self-protection.

Evo Morales stands accused of trying to rig an election in Bolivia. Former Lebanese Prime Minister Saad Hariri gave $16 million to a bikini model while his countrymen were scraping by. In the U.S., Washington insiders are rising up to curtail Trump’s normlessness. Data from the Corruption Perceptions Index show that people around the world feel that corruption is on the rise.

The populist/authoritarian regimes are losing legitimacy. The members of the urban middle class in places like Hong Kong and Indonesia are rising up to protect the political and social freedoms.

These days, it doesn’t take much to set off a giant wave of anger. In Lebanon it was a proposed tax on WhatsApp. In Saudi Arabia the government raised taxes on hookah restaurants. In France, Zimbabwe, Ecuador and Iran it was rising fuel prices. In Chile it was a proposed 4% rise in subway fares.

The world is unsteady and ready to blow. The overall message is that the flaws of liberal globalization are real, but the populist alternative is not working.

The protests in all these places are leaderless, so it’s unrealistic to expect them to have policy agendas. But the big question is, what’s next? What comes after the failure of populism?

The big job ahead for leaders in almost all these nations is this: Write a new social contract that gives both the educated urban elites and the heartland working classes a piece of what they want most.

The working classes who have been supporting populists need a way to thrive in the modern economy and a sense they are respected contributors to their national project. The educated elites want their democratic freedoms protected and to live in ethnically diverse pluralistic societies.

Whoever can write that social bargain wins the future.

David Brooks | The New York Times (Josh Haner/The New York Times)

David Brooks is an Op-Ed columnist for The New York Times.