IT WOULD be hard to imagine an immigrant more likely to succeed than Tarek. He has skills (a degree in economics) and experience (at a bank in Damascus). He has get-up-and-go, too. When the war in Syria grew too intense, he fled by car to Beirut, by plane to Turkey, by boat to Greece, by lorry to Denmark and by train to Sweden.

Yet after he applied for asylum in 2014, the Swedish government strove to prevent him from contributing to society. “For one and a half years I had to do nothing,” he recalls. He was sent to a refugee centre, where he was not allowed to work or take Swedish classes. Taxpayers gave him ample food and shelter. But he was barred from paying his way, and not working made it difficult to integrate, too. “It was very hard to connect with people,” says Tarek (who prefers not to give his last name).

From generous motives, Sweden has adopted policies towards refugees tailor-made to provoke a backlash. It has admitted huge numbers—for a while almost anyone arriving from Syria could get asylum. In 2015 the country let in 163,000, or 1.6% of the population. They received welfare benefits but most were not allowed to work. This has buoyed an anti-immigrant party, the Sweden Democrats, who might win the most votes in an election on September 9th (see article).

The rich world is gripped by a debate about what to do with newcomers from poor countries. In theory there are two completely separate categories: refugees from war or persecution, who have a right to safe haven, and economic migrants, who do not. In practice, however, many countries fail to honour their obligations to refugees, and plenty of economic migrants pose as refugees because they see no other legal way to enter a rich country.

For many voters, the two issues blur into one: what they care about is the number of foreigners arriving. According to Gallup, 700m people—14% of the world’s adults—would like to move permanently to another country, usually a rich one. In sub-Saharan Africa the figure is 31%. The rich world clearly could not absorb so many newcomers at once. And this is one reason why the politicians who complain loudest about the huddled masses are either winning elections (as in Hungary, Italy, Austria and America), or forcing other parties to rethink their open-door policies (Denmark, Sweden, Germany, Britain).

“We can’t take care of everybody,” says Anders Olin, who is handing out leaflets for the Sweden Democrats outside Malmo station. “It’s a burden on the welfare state. [Refugees] become citizens after a couple of years. Then the whole family comes.” In the past ten years, adds Mr Olin, “we’ve had many problems with violence and shootings.” He admits, however, that Malmo is still nice, whatever Donald Trump says, and that he does not personally feel threatened.

Niels Paarup-Petersen, the leader of the liberal Centre Party in Malmo, says that Sweden mishandled the refugee crisis of 2015. Asylum claims were processed too slowly, he says. The state should not have lavished so much money on each newcomer. “We were treating refugees under the age of 18 the same way we would treat a vulnerable, homeless Swedish kid, spending 2,000 kronor ($220) a night on giving them all kinds of nurturing. It wasn’t sustainable.” Rather than paying migrants to do nothing, Mr Paarup-Petersen thinks they should have been offered job training and language classes. “We have lots of vacancies for plumbers and welders,” he points out. Like the rest of Europe, Sweden has tightened its borders since 2015. Asylum applications have fallen by five-sixths.

Good migrations

For those who like their societies homogenous, almost any amount of migration is too much. However, the economic benefits of allowing a steady flow are potentially gigantic. An unskilled Mexican who moves to America raises his wages by 150%; a Nigerian, by 1,000%. Michael Clemens of the Centre for Global Development, author of the forthcoming book “The Walls of Nations”, estimates that if everyone who wanted to move were allowed to do so, the world would be twice as rich.

Could some of these gains be realised without too much disruption? Are there policies that would allow more long-term migration with the consent of native-born voters? As politicians scrabble for short-term fixes—a fence here, a holding pen there—few are asking these questions.

This article will focus on three rich places—Sweden, the United Arab Emirates (UAE) and America—and try to draw lessons from their different policies and experiences. In the United States, 13% of the population is foreign-born. In Sweden it is 18.5%. In both places this is roughly three times as high as in 1970, but in America’s case it is a reversion to a historical norm, whereas in Sweden it is a huge change for a previously monochrome society. In the UAE, nearly 90% of residents are foreigners—another huge change within less than two generations (see chart 1).

Sweden attracts surprisingly few highly skilled migrants from other rich countries, thanks to its cold weather and high taxes. Half of its foreign-born population comes from outside Europe. Iraqis and Syrians are the largest groups after Finns. Many locals fear that culturally distant newcomers will not adopt Sweden’s liberal values and will strain its generous welfare state. Emiratis have no such fears. Foreigners cannot drain their welfare state because they have no access to it. They come to work, and are thrown out if they stop working. It is virtually impossible for a foreigner to become a citizen. And though some locals fret that aliens will sully their culture, few wish to do their own laundry. America once had completely open borders—back when crossing the Atlantic took weeks and could be fatal. Now it lets in families of current residents, plus the skilled and those who are already rich. Unskilled migrants have almost no legal way in, though perhaps 11m immigrants live in America illegally. America has more foreign-born residents in total than any other country (43m). But as a share of the population, at 13%, it has fewer than Australia (28%) or Canada (22%). America’s current level is about what it was in the 19th century, but much higher than its nadir of 5% in 1970. It has not changed much in the past decade.

No country has a perfect system. But four policies can help maximise the benefits of immigration, minimise its costs and boost public support for it. First, the influx should be orderly and legal as well as humanely handled. This is not just because the rule of law matters. It is also because the perception of disorder fuels anti-immigrant sentiment. Public opinion in Canada (which borders only America) and Australia (an island with ruthless border security) is generally pro-migrant. A study by Allison Harell of the University of Quebec and others found that a strong predictor of people’s attitudes to migrants was whether they felt in control of their own lives, and whether they felt their country was in control of its borders. Thus, to win voters’ consent, any programme to let in more migrants must keep track of them.

The other three policies are all about integration. Migrants should be encouraged to work. They should be helped to fit in. And they should be seen to pay their way.

Migrants in the UAE obviously pay their way. They fill 99% of private-sector jobs, from designing skyscrapers to scraping dirty saucepans. Emirati citizens prefer to work for the state which, flush with petrodollars, pays fat wages for light work. Asked if he has ever seen an Emirati laying bricks in the scorching sun, a construction boss replies: “You know the answer.”

I get around

Raffy Fermin moved from the Philippines to the UAE to fix cars. Locals love flashy vehicles, but would not be seen dead under one. So Porsche, a German firm, sponsors a school in Manila that teaches young Filipinos how to service its machines. When they qualify, Porsche offers them jobs in the Gulf.

Mr Fermin arrived in Abu Dhabi in 2013, when he was 21. He works on cool cars in a cool workshop. He earns twice what he would at home, tax-free, sending 70% of it home to support his widowed mother and invest in property. He plans one day to go home and set up a car-repair business. “I’m happy I came,” he beams.

Some migrants have it much worse. In Saudi Arabia and Kuwait, they are often tied to one employer, whose permission they need to switch jobs. This gives horrible bosses immense power. Some fail to pay wages on time, or at all. Some confiscate workers’ passports, trapping them. Domestic workers are particularly at risk, since they work out of sight.

Many Westerners decry the way Gulf states treat migrants. Some think it immoral to offer them no chance of citizenship. But there is a trade-off. Because migrants have fewer rights, Gulf citizens are willing to admit more of them, relative to population, than Western countries. Most of the migrants benefit and want to stay.

Whereas the Gulf states have admitted vast numbers suddenly but temporarily, America has done it gradually but permanently. Babies born on American soil are automatically citizens. So immigrant families, even if they arrive illegally, can become American in one generation.

America’s flexible labour market makes it easy for migrants to find entry-level jobs, and its meagre welfare state means they have to. The unemployment rate for immigrants is 4% compared with 16% in Sweden, where benefits are fatter and unions have negotiated industry-wide pay scales that price unskilled migrants out of jobs (see chart 2). The National Academies of Sciences found that even immigrants who drop out of high school are net contributors to the public purse if they arrive in America before the age of 25.

Migration has also made America the innovation hub of the world. Immigrants are twice as likely as natives to start a company; more than 40% of the Fortune 500 were founded either by an immigrant or the child of one. Newcomers bring skills, connections and new ways of thinking. Gordana Vunjak-Novakovic, for example, moved to America in 1993, as her native Yugoslavia was falling apart. An engineer with an interest in biology, she found a job at the Massachusetts Institute of Technology. She got a green card in three weeks. “That would be unheard of today,” she laments. Now at Columbia University in New York, she has helped to launch four companies, including Epibone, which uses stem cells to grow new bones. It helps, she says, that New York mixes so many people from elsewhere, with such a wide range of perspectives and experiences. Two-thirds of the people she works with are immigrants or their offspring. She worries that the flow of foreign talent might be under threat. Just back from a trip to China, she notes that many students wanted to know if they were still welcome in America. The number of visas issued to foreign students fell by 40% between 2015 and 2017, to fewer than 400,000. America’s visa system is, by rich-country standards, unusually biased against talent. Of the 1m green cards (permanent residence visas) issued each year, only 15% are granted because of the applicants’ skills, notes John Dearie of Startups USA, a pressure group; in Australia the figure is 68%.

Historically each wave of immigrants, once settled, has worried that the next one will ruin America. “Our alms houses are filled with foreigners,” grumbled the Express newspaper in 1855. Others lamented that the aliens were “prone to violence” and “wedded to the worst forms of superstition”. They were referring to Catholics from Germany and Ireland, in language that echoes that used today about Muslims and Mexicans. German-Americans are now so well assimilated that most, like Donald Trump, no longer identify as such.

It is possible that recent immigrants, unlike all previous waves, will fail to assimilate. But there is scant evidence of this. Looking at such things as jobs, schooling, English ability and intermarriage, Jacob Vigdor of the University of Washington finds that recent immigrants to America are assimilating at least as well as those a century ago. A study by the OECD finds that the children of immigrants to America earn as much as the native-born, and are more likely to attend university.

Cultural assimilation is startlingly quick in America. Fully 60% of foreign-born Latinos speak mostly Spanish, but by the next generation this has fallen to 6%, according to the Pew Hispanic Center. Some 15% of newlywed foreign-born Hispanics in 2015 were hitched to non-Hispanics; among US-born Hispanics it was a whopping 39%. For Asians the figures were 24% and 46%. Five years after refugees arrive in Sweden, only 3% of women and 4% of men are in a relationship with a native Swede.

Don’t worry, baby

Studies probably underestimate assimilation. The reason is what demographers call “attrition”: when migrants have lived in America for a couple of generations, they often cease to identify as “Mexican-American” or “Hispanic”. In the first generation, 99% use such ethnic labels; by the sixth generation, only 6% do. One reason for this is intermarriage—those with only one Hispanic parent are much less likely to call themselves Hispanic. Since Hispanics who intermarry tend to be better educated than those who don’t, surveys that rely on self-identification (ie, most of them) probably greatly underestimate their progress.

Most of the benefits of migration go to the migrants themselves. And because so many voters object to cultural disruption, far less migration happens than would be optimal. Perhaps, then, ways should be devised to share some of the material benefits of migration with those voters, to persuade them to allow more of it.

The simplest way would be for migrants to pay to migrate. Several countries offer visas to those who invest a certain sum of money. Gary Becker, an economist, suggested auctioning them to the highest bidder. The money could then be used for popular causes such as shoring up public pensions or health care, or simply divided equally among citizens. Suppose that America accepted enough migrants to increase its population by a third, and each migrant paid $6,000 a year for the privilege. A native-born household of four would earn about $8,000 a year from such an arrangement, estimate Eric Posner and Glen Weyl, the authors of “Radical Markets”. Since the median income is about $50,000, that would give them a hefty stake in more open borders. The migrants themselves would make similar absolute gains, even after paying the fees, and much more in percentage terms.

Mr Posner and Mr Weyl suggest an even bolder plan. What if each citizen could sponsor one migrant from a poor country, and take a cut of his earnings? This would create a direct personal link between newcomer and local. The migrant might stay in the citizen’s spare room. He would be free to quit and go home, but not to disappear and work in the black market. This system would require rules against hiring illegal workers to be strictly enforced.

Nearly every rich country has an ageing population and a shortage of workers to care for them. Yet surprisingly little effort has been made to train foreign workers to meet this demand. The German government, anticipating a huge shortfall of geriatric nurses, is training young Vietnamese in Hanoi in both nursing and the German language. But such examples are rare.

Wouldn’t it be nice

The biggest worry about immigration is that it might undermine the very thing that makes it attractive. Poor countries tend to have bad institutions. Rich countries have good ones—that is why they are rich. Poor people move to rich countries to enjoy the benefits of good institutions. But what if so many of them move that they swamp those institutions, replacing the norms of Switzerland, say, with those of Nigeria?

Another way of putting this is: how many newcomers can rich countries absorb? American history suggests: a huge amount, over time. Its population has swollen from some 5m (including 900,000 black slaves) in 1800 to 320m of many colours today. Mr Clemens and Lant Pritchett of Harvard devised a model to see how much immigration would be necessary to make rich-country institutions start to become more like those in poor countries, extrapolating from what can be observed today. Their answer was: far more migration than is currently plausible. The cultures of rich countries are both strong and attractive. Migrants typically move to the West because they like it. By and large, they obey its laws and adopt many of its customs, and its institutions remain strong.

In 2005 a Danish newspaper published 12 cartoons of the Prophet Muhammad. Riots erupted in several Muslim countries. Some 200 people died. It was the worst cultural clash between Danes and Muslim immigrants in recent times. Yet the country has moved on. Ahmad Akkari, one of the Danish Muslim leaders who toured the Middle East stirring up outrage, regrets having done so. “I was part of a movement that led to catastrophic events,” he says.

Shocked by the violence, he retreated and read Karl Popper’s “The Open Society and Its Enemies”, twice. He realised that he had taken Western freedoms for granted. “If I had protested over cartoons in Saudi Arabia or Iran, they would have hanged me.” He adds that many Muslims who have grown up in Denmark “don’t realise how Danish they are”.

As for Tarek, the Syrian refugee in Sweden, eventually he was granted asylum and allowed to work. He found a job as a data analyst. He has brought his family over, and is much happier. He praises the way Christians and Muslims can live peacefully side by side in Sweden—though he says he would like to go back to Syria, if the war ends, to help rebuild his country. Meanwhile, he has a modest dream. “I’d love to take up golf,” he says.