C OMPARE AND contrast. In 2015 thousands of irregular migrants and asylum-seekers entered Hungary, en route to Germany. Hungary’s prime minister, Viktor Orban, built a fence along the country’s southern border to stop them. The European Commission chided Mr Orban. “We have only just torn down walls in Europe; we should not be putting them up,” tutted a flack for the European Commission. Fast forward five years, and ugly scenes erupted at the EU ’s borders once again. Migrants trying to reach Europe on a dinghy were greeted by a Greek vessel, whose crew hit the boat with sticks and fired warning shots at them. This time the commission had a different response. “I thank Greece for being our European aspida [shield] in these times,” said Ursula von der Leyen, the president of the European Commission. What changed?

Two visions of the EU competed during the migration crisis of 2015 and 2016, when more than 2m people flooded into the bloc. On one side stood the humanitarians, who viewed the EU as a normative power, a shining light on a hill. For them, the response was a moral question with a simple answer: Willkommenskultur. On the other side were the hardliners. Their argument for stiff, brutal measures at the border was based on practicality (a state can only feed and house so many refugees at once) and politics (voters will kick out anyone who allows too large and sudden an influx, sharpish). After five years of wrestling, the humanitarians have been routed. Now the hardliners reign supreme.

Brutality at the border is now a central feature of European migration policy. The misery is no coincidence. Anyone who makes it to Greece faces dreadful conditions. On the Greek island of Lesbos 20,000 people are stuck in a camp designed for a seventh of that number. The Greek government is building new facilities, but these will come with strict rules on when asylum-seekers may come and go. Anyone who makes it out of Greece is liable to be beaten up by police at the Croatian border, who have been accused of pummelling and robbing migrants before dumping them back into neighbouring Bosnia. Deterrence trumps principle or, in some cases, the law. (Greece has suspended asylum applications for a month, arguing with some justification that the recent influx of people is being orchestrated by the Turkish government, which wants the EU to give it more money.) Officials are eager to focus on what has become the EU ’s guiding philosophy on migration: pour décourager les autres.

Tactics that were once the demands of a nationalist fringe have been adopted by mainstream governments. NGO vessels operating in the Mediterranean have been impounded and their crews harassed. Those who help people making the trip to Europe, by organising food and water along migratory routes, face charges of people-smuggling. Mediterranean patrols have been scaled back lest they act as a pull factor, encouraging people to brave choppy waters in the hope of being rescued by the coastguard.

Morality still sometimes rears its head. European leaders are not always comfortable with their choice. They grab policy figleaves to hide their shame whenever possible. Leaders from a handful of states this month cooked up a scheme to relocate minors abandoned in miserable camps on Greek islands. Legally, refugee status has nothing to do with virtue. Being a refugee is not about the content of your character but the misery of your circumstance. But politically it is far easier to move women and children than 25-year-old single blokes, even if all are in danger.

Though some wrestle with the hardline turn, most officials are happy to justify it. Ugly scenes at the frontier are a necessary evil for convenience in the interior, goes one argument. Border control is never pretty. A strong external border is required if Europeans are to zip between Schengen countries with nary a flick of a passport. The situation in 2015, when the EU ’s frontier was patently not secure, was untenable. At the moment, the main threat to Schengen is coughing Italians or sneezing Germans. Poland has introduced health checks for arrivals from Germany, and Slovenia has closed some of its border-crossings from Italy. Freedom of movement is fragile, even without a refugee crisis.

The most persuasive justification for all this is that hard borders may allow political space for softer measures, such as resettling refugees directly from trouble spots. Unfortunately, that is not how it seems to be working: only 65,000 refugees have been resettled in the EU since 2015. Another possible excuse is that a second refugee crisis might help far-right parties win elections, just as the first one helped trigger Brexit and the rise of Italy’s Matteo Salvini. Consequently, governments seem happy to do nearly anything to keep asylum-seekers at bay, even if that means aping the parties they are determined to keep out of power.

Good walls and good neighbours

A tough border is something with which all European leaders agree. What happens if people breach it is another matter. Reforms to EU laws on how to share responsibility for asylum-seekers and irregular migrants have made little progress in four years. If Greece fails to control the situation, as in 2015 and 2016, things could turn ugly quickly. Other EU countries would have few qualms about pushing on with plans for a much smaller Schengen area, consisting mainly of rich, prosperous countries in the bloc’s north, far from awkward external borders. A renewed crisis would potentially be even more bitter than the first. Keeping people out by any means necessary keeps this existential problem for the EU at bay.