Illegal migration across the Mediterranean has tripled since the overthrow of Muammar Qaddafi in 2011 opened the ports of Libya to human smuggling on an unprecedented scale. Some 50,000 migrants made the crossing to southern Europe in the first four months of 2015. Another 1,800 died at sea.

Hundreds of thousands more people are estimated to be waiting in Libya for the chance to cross into Europe. Millions more would follow if they could. The migrants come from a vast swath of Africa and the Middle East, spanning not only war-torn Syria (in the first four months of 2015, Syrians accounted for just 30 percent of those crossing the sea) but also Nigeria and the Gambia and Eritrea and Somalia and Mali. They wish to leave behind poor, unstable countries in order to seek opportunity in the wealthy lands of the European Union. It’s a dangerous gamble. But the prize is huge.

Of the 170,000 migrants who made landfall in Italy in 2014 (Italy being the most common destination for migrant boats last year), reportedly only about 5,000 have actually been deported. Sixty percent of those who sought asylum in the country last year were granted refugee status or other protections upon their first request. (Still more received such status on appeal.) Many migrants don’t wait for a hearing. They spend a few days in an overcrowded reception center, then abscond north to the stronger job markets of France, Germany, and beyond. Italian authorities are sometimes accused of conniving at this escape, so as to lessen the burden these new arrivals pose to Italian taxpayers.

The migrants who embark upon this journey are typically represented as terrorized and impoverished—as people driven (to quote Amnesty International) “to risk their lives in treacherous sea crossings in a desperate attempt to reach safety in Europe.” The demographic and economic facts complicate that story. When populations flee war or famine, they generally flee together: the elderly and the infants, women as well as men. The current migrants, however, are overwhelmingly working-age males. All of them have paid a substantial price to make the trip: it can cost upwards of $2,000 to board a smuggler’s boat, to say nothing of hundreds or even thousands of dollars to travel from home to the embarkation point in the first place. Very few of the migrants from Libya are actually Libyan nationals.

Doug Saunders, a British Canadian journalist who has spent considerable time reporting from North Africa and the Middle East and who in 2012 published a book that was sympathetic to trans-Mediterranean migrants, rejects as “insidious” the notion that such migrants are fleeing famine and death. To the contrary, he wrote recently:

Every boat person I’ve met has been ambitious, urban, educated, and, if not middle-class (though a surprising number are …), then far from subsistence peasantry. They are very poor by European standards, but often comfortable by African and Middle Eastern ones.

What these migrants are doing is what migrants have always done: they’re pursuing a better life. But although migration is attractive to the migrants, it is unwanted by European electorates—and the tension between continued migration and public opinion is changing the Continent in dangerous ways.

Across the European Union, 57 percent of residents express negative attitudes about immigration from outside the EU. Naturally, elected politicians take the popular view and promise sharp reductions in immigration. And yet, the reductions never come, because the EU has encoded refugee rights into laws and treaties that cannot easily be changed. As a result, migrants have enormous incentives to present themselves as refugees. In turn, those European elites who favor higher levels of migration pretend to believe them. Altogether, the realities of trans-Mediterranean immigration are thus tightly swaddled in lies.

Leaders throughout the eurozone are already presiding over a precarious situation, thanks to continuing budget austerity and very high unemployment. Voters’ inability to affect policy further damages the credibility of democratic politics, and strengthens “anti-party parties” such as France’s extremist National Front.

The trip across the Mediterranean is short in kilometers, but quite long in psychic distance. A migrant crossing to Italy today leaves behind a world of informal rules and enters a world governed by written laws, formal credentials, and bureaucracy—a world where his own credentials (if he has any) count for nothing. He will enter a labor market in which both the employment rate and the relative wage of low-skilled workers have been declining for years. He may accept these conditions as an improvement. His children won’t.

Completing the journey from the one world to the other takes more than a single generation, even under the best of circumstances. And in Europe’s case, the circumstances have left much to be desired. Compared with the United States, European societies have struggled to absorb and assimilate immigrants, and the struggle has only become harder as European economies have slumped. Now Europe is learning that today’s refugees are at high risk of becoming tomorrow’s high-school dropouts, tomorrow’s unemployed, and tomorrow’s criminals.

Immigrants from non-EU countries are twice as likely as natives to drop out of secondary school. Those of working age are twice as likely to be unemployed. Immigrants are also hugely overrepresented in the prisons of France, Britain, Belgium, and other European countries. Furthermore, a 2014 study in The Economic Journal found that each year between 1995 and 2011, immigrants from outside the European Economic Area were a net drag on the United Kingdom’s budget.

The poorer the country from which migrants come, the higher the social cost of absorbing them. Consider the experience of Sweden, which on a per capita basis has one of Europe’s largest immigrant populations. More than 15 percent of Swedes are either foreign-born or were born in Sweden to two foreign-born parents. The country has extended a special welcome to refugees from some of the world’s most troubled places, including Somalia, Iraq, and Syria. But as Sweden’s intake from poor countries has grown, the economic performance of its immigrant population has lagged. The Economist reports that in 1991, the median income for non-European immigrant households was 21 percent below that of long-settled Swedish households. By 2013, the gap had widened to 36 percent.

Immigrants’ economic frustration and ensuing social isolation has in turn fostered political radicalization and violent extremism. Extremist views are held by a minority of immigrants, but that minority poses Europe’s severest internal security threat since World War II. In response to this growing threat—which is traceable to migration—European governments have imposed ever-tightening surveillance upon their societies. Thus, as Christopher Caldwell lamented several years ago in Reflections on the Revolution in Europe, his superb book on how migration has transformed Europe, the price of increased diversity has been diminished liberty.

Migrants on the Italian island of Lampedusa in February, as they wait to board a plane bound for a reception center elsewhere in Italy. (Tullio M. Puglia / Getty)

All of this has produced a dismaying confluence: frustration among migrants and their children, resentment on the part of older citizens, rising extremism on one side, authoritarian xenophobia on the other, and an increasingly obtrusive (if ineffective) security state. Many people on both sides of the Atlantic find these facts uncomfortable to acknowledge. But if mainstream leaders won’t respond to the uncomfortable, demagogues will.

Even as migration has imposed significant fiscal and social costs on Europe, it has made little impact on the number of actual refugees worldwide. Nor would one expect it to: there are simply too many refugees around the globe for long-distance resettlement to be a panacea. Most refugees either remain within their country of origin as “internally displaced persons” or else settle in the nearest place of safety. From a purely technological and organizational point of view, the global community is becoming quite good at aiding refugees: Syrian refugee camps in Jordan and Turkey, for example, are increasingly equipped with running water, sewage disposal, schools, and electricity.

Much harder is creating economic opportunity within these overnight cities, and preventing extremism from taking hold. Harder still: prompt resolution of the wars that displace people in the first place. These difficulties are not eased by the continued insistence that advanced countries accept the illegal migration of the most mobile, most assertive, and generally least vulnerable people from the poorer parts of the world.

Europe now can follow one of two examples: a cautionary one offered by the United States, or a more hopeful model set forth by Australia.

Beginning in 2012, the United States faced a surge in illegal entries by unaccompanied minors from Mexico and Central America. The number of such migrants apprehended at the U.S.-Mexico border jumped 60 percent from 2012 to 2013, and 75 percent from 2013 to 2014. Throughout the crisis, many news reports insisted that they were refugees fleeing lethal chaos in their home countries. But Central America had not become appreciably more chaotic—in fact, the murder rate in Honduras, the largest sending country last year, dropped by some 20 percent from 2012 to 2014. Most of the unaccompanied minors were males, many of them likely responding to a perceived opportunity: a series of changes in U.S. policy since 2008 seemed to promise that young migrants would not be sent home. The surge in attempted border crossings began to subside only recently, after the U.S. persuaded the Mexican government to help apprehend migrants as they passed through that country.

Contrast this with the recent experience of Australia. After the Labor government of Prime Minister Kevin Rudd announced a newly permissive policy toward asylum-seekers in 2008, their numbers, unsurprisingly, soared. As holding facilities filled, Labor leaders moved to reintroduce stricter controls, but public opinion had already turned against them: the party lost the 2013 federal election to Tony Abbott, a conservative who had, among other campaign promises, vowed to crack down on asylum-seekers arriving by boat. Under Abbott’s policy, no unapproved boats would be allowed to land. Period. Boats apprehended at sea would be turned back to their point of origin or towed to uncongenial places like Papua New Guinea for processing of passengers. The government used social media to communicate the new policy throughout Southeast Asia. A YouTube video released in many of the region’s languages warned: “If you travel by boat without a visa, you will not make Australia home.” Since then, illegal boat migration has virtually disappeared.

The policy has been expensive: the government has reportedly spent about $1 billion Australian a year to detain migrants at facilities in other countries. That is a relatively small sum, however, compared with the high social and economic costs over many years—and multiple generations—of allowing large-scale migration by very low-skilled people.

The ocean around Australia is much wider than the sea between Libya and Europe. Yet Australia’s example is promising. Migration follows opportunity. Remove opportunity, and migration will cease. Migrants who attempt to force their way into Europe are, quite understandably, seeking a better life. But the peoples of the countries they wish to enter similarly have a right to do what is best for themselves.

Making a success of the migration that has already occurred will demand tremendous wisdom, generosity, and policy creativity from Europe’s leaders. That challenge will become only more daunting if migrant numbers continue to grow unchecked, thanks to an immigration policy that prides itself on being compassionate, but that in practice perpetuates the darkest and most dangerous tendencies of Europeans, old and new alike.