This world is an increasingly polarized place. Divisions are growing not just between countries but within them. In my book Us vs Them: The Failure of Globalism I set out why this is happening now. Here, five key factors dividing today’s world into “us” and “them.”

1. Economics

The growing division of wealth between haves and have-nots has received plenty of attention in recent years—when 42 people in the world have the same wealth as the bottom 50 percent, the headlines write themselves. But attention is one thing, and action another.

Free trade remains the best way we know to spur sustainable economic growth for the world as a whole. Moving goods, services, investment, and innovation as efficiently as possible generates consumption, a virtuous cycle that has seen the world economy soar nearly 700 percent since 1980. Hundreds of millions around the world have escaped poverty, largely thanks to globalization.

But not all countries and peoples share in this virtuous cycle equally. Countries and specific sets of workers lose when jobs and opportunities are sent abroad for the sake of profit margins. And when infrastructure spending, public school systems, health care and the like are tied directly to the economic fortunes of a community, it compounds problems of inequality. It’s taken a couple of generations—and the sharp shock of Brexit plus the election of Donald Trump—for this to become unavoidably obvious for globalization’s still-complacent winners in Europe and the U.S.

2. Society and culture

In a globalized world, people flow across borders too. When workers see threats to their lives, livelihoods, status, and entitlements, they demand walls — barriers against cheap labor and unfamiliar faces—or what you might call “them.”

Donald Trump understood this better than any of his political rivals in the U.S. Through storm after storm, and despite his inability to “drain the swamp” in Washington, his most loyal supporters stick with him, because no one else in the United States can credibly promise to defend their interests against establishment disdain.

Most politicians call for unity. Trump speaks of “us vs them” and continues to reap the rewards.

3. Security

Cultural divides also bleed into the security realm. Global trade demands geopolitical stability. Stability requires leaders willing to do more so others can do less, who use their power to impose the compromises on which multinational progress depends.

But Trump defeated 16 Republicans and Hillary Clinton with promises that America would defend no interests but her own. He derided endless pointless wars and the presidents responsible for them. And while it was America’s political and military establishment that argued for the necessity of all these wars, they were wars waged on the backs of working-class American men and women. When they returned home, they found a world not much safer than the ones they risked their lives to defend. Even worse, instead of being treated as heroes, they were barely treated at all by a dysfunctional veterans administration system.

And then there’s the bundling of immigration concerns with terrorist fears. In the U.S., it’s a narrative that has been politicized for years but has little basis in reality. Europe is another matter; some European communities have historically had a more difficult time integrating immigrant populations, and the threat posed by homegrown jihadi militants, radicalized in slums like the banlieues of Paris and neighborhoods like Molenbeek in Belgium, is all too real.

4. Technology and filter bubbles

The Internet has long been used to connect folks seeking like-minded individuals in chat forums and online communities. But with the advent and explosion of social media, echo chambers took on a life of their own. Today, it takes work to find someone with whom you fundamentally disagree—people gravitate to others who share their values and assumptions about their communities and the world.

Human nature isn’t only to blame, though. Tech and media companies now grow their bottom lines by maximizing the amount of time you spend engaging with content on their platforms. Algorithms are designed to show you content you’re expected to “like” and engage with, with the result being narrower demographic groups that help advertisement targeting and data collection. The result is ever more political fragmentation in the cyber sphere, which manifests itself more profoundly in the real world with each election cycle.

5. Technology and automation

And the tech revolution is still only in its infancy. People talk about the coming era of automation and artificial intelligence (AI) as the “fourth industrial revolution,” placing it (somewhat comfortingly) in historical context. But we’ve never seen anything on the scale of what’s to come—automation and AI are expected to cost 400 to 800 million people their jobs by 2030. T

The world may produce more with robots at the helm, but the economic gains will go mostly to the few who control the technology; hundreds of millions of others will be left with less work to do (if they find work at all). And for all the talk of retraining to prepare people for this automated future, few of those plans have come to fruition. If anything, we should be preparing for a “post-industrial revolution,” one that looks set to widen the chasm between “us” and “them” still further.

And to think that all this fracturing into groups, pitting us against them, is happening at a time when the global economy is growing at a solid clip. In today’s polarized environment, one global economic stumble may be enough to shatter our interconnected world completely.