Shipping containers sit on a dock in Los Angeles. (Lucy Nicholson/Reuters)

The writer is a professor at and past president of Harvard University. He was treasury secretary from 1999 to 2001 and an economic adviser to President Obama from 2009 through 2010.

Since the end of World War II, a broad consensus in support of global economic integration as a force for peace and prosperity has been a pillar of the international order. From global trade agreements to the European Union project; from the work of the Bretton Woods institutions to the removal of pervasive capital controls; from the vast expansion in foreign direct investment to major increases in the flow of people across borders, the overall direction has been clear. Driven by domestic economic progress, by technologies such as containerized shipping and the Internet that promote integration, and by legislative changes within countries and international agreements between countries, the world has gotten smaller and more closely connected.

This broad program of global integration has been more successful than could reasonably have been hoped. We have not had a war between major powers. Global standards of living have risen faster than at any point in history. And material progress has coincided with even more rapid progress in combating hunger, empowering women, promoting literacy and extending life. A world that will have more smartphones than adults within a few years is a world in which more is possible for more people than ever before.

Yet a revolt against global integration is underway in the West. The four most prominent candidates for president of the United States — Hillary Clinton, Bernie Sanders, Donald Trump and Ted Cruz — all oppose the principal free-trade initiative of this period: the Trans-Pacific Partnership. Trump’s proposals to wall off Mexico, abrogate trade agreements and persecute Muslims are far more popular than he is. The Brexit movement in Britain commands substantial support and could prevail. Whenever any aspect of the E.U. project is submitted to a popular referendum, it fails. Under pressure from a large influx of refugees, the European commitment to open borders appears to be crumbling. In large part because of political constraints, the growth of the international financial institutions has not kept pace with the growth of the global economy.

One substantial part of what is behind the resistance is a lack of knowledge. Everyone who loses a job because a factory moves abroad knows it; many who lose their jobs for local reasons blame globalization. But no one thanks international trade for the fact that their paycheck buys twice as much in clothes, toys and other goods as it otherwise would. Those who succeed as exporters tend to credit their own prowess, not international agreements. So there is certainly a case for our leaders and business communities to educate people about the benefits of global integration. But at this late date, with the trends moving the wrong way, it is hard to be optimistic about such efforts.

The core of the revolt against global integration, though, is not ignorance. It is a sense — unfortunately not wholly unwarranted — that it is a project being carried out by elites for elites, with little consideration for the interests of ordinary people. They see the globalization agenda as being set by large companies that successfully play one country against another. They read the revelations in the Panama Papers and conclude that globalization offers a fortunate few opportunities to avoid taxes and regulations that are not available to everyone else. And they see the kind of disintegration that accompanies global integration as local communities suffer when major employers lose out to foreign competitors.

What will happen going forward? What should happen?

Elites can continue on the current path of pursuing integration projects and defending existing integration, hoping to win enough popular support that their efforts are not thwarted. On the evidence of the U.S. presidential campaign and the Brexit debate, this strategy may have run its course. This will likely result in a hiatus from new global integration efforts and an effort to preserve what is already in place while relying on technology and growth in the developing world to drive any further integration. The historical precedents, notably the period between World Wars I and II, are hardly encouraging about unmanaged globalization succeeding with neither a strong underwriter of the system nor strong global institutions.

Much more promising is this idea: The promotion of global integration can become a bottom-up rather than a top-down project. The emphasis can shift from promoting integration to managing its consequences. This would mean a shift from international trade agreements to international harmonization agreements, whereby issues such as labor rights and environmental protection would be central, while issues related to empowering foreign producers would be secondary. It would also mean devoting as much political capital to the trillions of dollars that escape taxation or evade regulation through cross-border capital flows as we now devote to trade agreements. And it would mean an emphasis on the challenges of middle-class parents everywhere who doubt, but still hope desperately, that their kids can have better lives than they did.