Angela Merkel has supported a UN migration compact, but not everyone is happy with it.Abderrahmane Mokhtari / Reuters

An international migration pact adopted by the vast majority of the world’s nations aims to better handle rising flows of migrants worldwide, explicitly upholds national sovereignty, and is not legally binding. Why, then, is much of Europe freaking out over it?

The United Nations Global Migration Compact, signed this week by 164 countries, has been years in the making, and includes relatively uncontroversial goals such as improving data collection. In a sign of its import, German Chancellor Angela Merkel—whose legacy will likely be defined by her decision to allow more than 1 million refugees into her country in 2015 and 2016—flew in to Marrakech, Morocco, for the signing ceremony, arguing that it was “worth it to fight for this pact.”

Just days earlier, though, the German leader was in Hamburg as her own political party debated whether it would even support the compact, a fight playing out across much of the continent. The agreement has roiled politics in more than half a dozen European countries, with several following the lead of the United States in pulling out of it entirely. Such moves point to a deepening mistrust across the region toward migration as populist and far-right parties gain support.

Germany’s experience offers a lesson in the factors driving opposition to what is a mostly technocratic compact—one that had been crafted specifically in response to the very trends that are now opposing it.

Merkel had won plaudits internationally for her decision to welcome an enormous number of migrants into Germany at the height of Europe’s migration crisis, a move that remains her signature decision, and one that had defined the race to replace her as head of her party this month. Under pressure from the far-right, anti-immigration Alternative for Germany (AfD), which has waged a vocal campaign to stop the migration compact, some in Merkel’s Christian Democratic Union, including one ultimately unsuccessful candidate to succeed her, had suggested that the issue of Germany joining the UN agreement should at least be open for discussion. Last month, the CDU chapter in the former East German state of Saxony-Anhalt voted to reject the compact entirely, with the state-level parliamentarian Lars-Jörn Zimmer saying it would effectively “open the gates unconditionally.”

Ultimately, the CDU voted overwhelmingly in favor of the pact at its party congress in Hamburg last Friday—as did Germany’s Parliament, which held a similar debate in November. But the fact that the compact was even a topic for debate shows the extent to which rising right-wing populist parties set the terms of debate even when they’re not in power, as well as just how much of a lightning rod this nonbinding UN pact has become.

“We all know that illegal migration, because of the different development opportunities around the world, has caused part of the great fear in our countries,” Merkel said in Marrakech. “And these fears are being used by the opponents of this pact.”

More than half a dozen other European countries have also questioned whether to join the pact in the lead-up to this week’s UN gathering. The first domino to fall was Austria, which pulled out of the agreement in October despite negotiating it on behalf of all European Union countries (except Hungary). Austria’s chancellor, Sebastian Kurz, leads a coalition government with the far-right Freedom Party (FPÖ) and has shifted his country sharply to the right on migration since taking office a year ago. Since then, Bulgaria, Hungary, Poland, and Slovakia have all said they will not sign it either.

In some places, the debate over the pact is having even more dire political consequences: Over the weekend, the New Flemish Alliance, a nationalist party, withdrew from Belgium’s center-right ruling coalition over the country’s decision to adopt the agreement, leaving the now-minority government on the verge of collapse.

Why is the UN compact, which is nonbinding, so controversial? Arguments against it include the idea that it will ultimately lead to a “human right to migration” and that domestic courts could use it in deciding immigration cases. That it explicitly states that it upholds national sovereignty and has no legal standing has done little to assuage those concerns.

The compact itself emerged at the 2016 UN General Assembly in New York, was negotiated over the next two years, and was finalized in June 2018. It lists 23 objectives that include goals such as better collection of data, minimizing the factors that cause people to emigrate, and providing flexible pathways for legal migration. It was designed as a way for countries to work together to better handle the issue in the wake of Europe’s difficulty in managing the more than 1 million people who crossed the Mediterranean in 2015.

“Europeans were starting to get a sense that the governments had lost control of their borders,” said Louise Arbour, the UN Special Representative for International Migration who led the process that resulted in the agreement. Negotiators acknowledged that immigration was a matter of state sovereignty, but also that migration increased interdependence between countries. Discussions were based on demographic and labor-market projections, not “mythology about identity and all kinds of intangible arguments that [are] … now being advanced,” Arbour said.

The crisis that proved the impetus for the compact has now long since passed. Desperate migrants still cross the sea to reach Greece, Spain, and Italy, often with fatal consequences, but at far lower rates than at the height of the emergency that paralyzed Europe three years ago. The latest data show that crossings of the Mediterranean are at multiyear lows.

Fewer people may be reaching Europe, and more migrants may be turned away, but the populist wave unleashed by the crisis has yet to recede. Anti-immigration parties govern in Hungary, Poland, and Slovenia; are part of the ruling coalition in Italy and Austria; and are influential in Denmark, Finland, and the Czech Republic. It’s hardly a coincidence that many of these countries are the ones that said they wouldn’t go to Marrakech to sign the compact. Neither will Australia, Israel, and Switzerland. Their positions are evidence of a growing skepticism toward multilateralism and international institutions across the world.

These right-wing parties’ rhetoric about a continuing, unstoppable flow of migrants is clearly hyperbole. But at least in Germany, those arguments get at the very real challenges of integrating the vast number of newcomers who have already arrived—many of whom face language barriers, a daunting German bureaucracy, and a lack of available jobs at their skill level as they seek to settle in.

In the German school system, for example, research shows that many of the more than 130,000 new refugee and migrant students end up in disadvantaged schools without the resources to help them catch up. And Germany’s apprenticeship and training programs, which are held up as the gold standard internationally, aren’t easy for arriving refugees and migrants to break into. As a result, many of them are not on track to be eligible for skilled labor positions and are instead forced to compete for a smaller pool of unskilled jobs. (That said, statistics from Germany’s labor office suggest that more refugees began to find jobs in 2018.)

What’s more, a series of high-profile criminal cases involving refugees and asylum-seekers contributes to the perception that migrants pose not only an integration problem, but also a security threat. Last summer, a missing 14-year-old girl was found raped and murdered in the western German city of Wiesbaden; the prime suspect in her murder was a 20-year-old Iraqi asylum-seeker. “If he had been deported, she would still be alive,” read a headline in Bild, Germany’s most widely read tabloid, with a circulation of about 1.5 million.

The AfD draws attention to both the violent headlines and the more structural problems with integration to make its case for curbing migration. “2015 is only the tip of the iceberg,” Beatrix von Storch, an AfD politician from Berlin, wrote on Twitter Monday as she linked to coverage of findings from the Organization for Economic Cooperation and Development on the comparatively low education level of Germany’s foreign-born inhabitants.

As the debate in Germany shows, rhetorical pressure from the far right has forced mainstream parties to talk differently about migration issues—and to debate things such as this compact that previously might have been taken for granted.

“We cannot accommodate everyone,” Andrea Nahles, head of the center-left Social Democrats, said this summer. Even those CDU leaders who argued in favor of the compact in Hamburg spoke about curtailing immigration: “We all agree,” said Ralph Brinkhaus, the CDU’s leader in the German Bundestag, “that migration needs to be limited and controlled.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.