IN HIS novel “Exit West”, Mohsin Hamid describes a world very like our own, but which is suddenly changed by the appearance of mysterious doors. A dark-skinned man falls out of an Australian woman’s wardrobe in Sydney. Filipino women emerge from the back door of a bar into the alleyways of Tokyo. As the incidents multiply and scores of people from poor countries walk through the doors into richer ones, rich-world inhabitants respond with violent resistance. Governments crack down hard on the new arrivals. But it is not long before they are overwhelmed by their sheer number and abandon efforts to repel them. The world settles into an uneasy new equilibrium. Shantytowns emerge on the slopes of San Francisco Bay. Conflicts in war-torn places burn out for want of civilians to kill and exploit.

Mr Hamid’s story comes close to what many advocates of open borders believe the world would look like if people were free to move wherever they wanted: fairer, freer, with more opportunities for a larger number of people. But it also nods to the fears many people have about unfettered migration: uncertainty, disorder, violence. Would such a world be a dream or a nightmare? The answer depends on whom you ask.

Few things have caused citizens in Western liberal democracies more angst in recent years than borders and migration. In the United States, voters chose a president in 2016 who promised to build a wall to stem the flow of migrants from Mexico and elsewhere in Latin America, and who has since sought to ban people from several Muslim-majority countries from travelling to America. In many European countries, right-wing parties have risen to prominence on an anti-immigration platform. Concerns about immigration played a major role in the British vote to leave the European Union in the summer of 2016. When Angela Merkel, Germany’s chancellor, opened her country to hundreds of thousands of refugees from the Syrian war in the summer of 2015, she was applauded for her humanitarian impulse. But two years later, German voters punished her party at the polls for what many now argue was a rash and irresponsible decision. A big share of the vote went to a party that promised strict limits on immigration. So has migration gone too far already? Or would the world be a better place if borders were more open than they are?

Advocates of entirely open borders tend to advance two types of arguments. The first is economic. Opening all borders would make the world instantly richer. Some believe that it could double the world’s GDP. That is because workers become more productive as they move from a poor country to a rich one. They join a labour market with ample capital, efficient firms and a predictable legal system. If they are service workers, they will find richer and better-paying clients. By some estimates, more than two-thirds of a person’s overall wealth is determined by where they live and work.

The second argument for open borders is a moral one. Where someone is born is entirely a matter of chance, so there is no moral justification for compelling people to stay in a poor country. By the same token, those lucky enough to have been born in rich countries have no right to exclude others from their good fortune. Opponents of open borders are not convinced by either of those arguments. Even if the world as a whole were to grow richer thanks to open borders, they say, poorer people in the migrants’ destination countries would suffer. The new arrivals would depress their wages and compete with them for resources such as social housing and unemployment benefits. The welfare states that Western democracies have painstakingly built over the past few decades would collapse under the task of absorbing millions of people ill-suited to local labour markets. Cultural conflicts between natives and immigrants would before long cause violent clashes, threatening social stability.

They question the moral case, too. The first duty of democratic governments is to their citizens, they argue. If a majority of these citizens oppose large-scale immigration (as is the case in several European countries), the government cannot simply ignore their wishes, even if it thinks it would take the moral high ground by doing so. By that logic, Mrs Merkel’s unilateral decision to invite refugees into Germany was not so much a laudable humanitarian gesture as a sign of her contempt for the German electorate.

Most people are neither for nor against open borders, but somewhere in between. The policies of many liberal democracies incorporate elements from both sides. They tend to recognise the right of asylum for those persecuted in their home countries. But they also have caps on immigrant numbers and laws providing for the deportation of the unwanted. Moreover, most countries distinguish between refugees, who are fleeing political persecution or war and must be given shelter, and economic migrants, who are “merely” seeking a better life and are only welcomed under certain conditions.

Whatever one’s view of open borders, there is little doubt that existing migration policies are no longer fit for purpose. The UN estimates that 258m people now live in places other than their country of birth, an increase of nearly 50% since 2000. Around 65m have been forcibly displaced either within their own country or outside it. Most of them are in poor or middle-income countries. For all the debates raging in Europe and America, rich countries still take in only a small fraction of the world’s most vulnerable migrants. Rich countries can and must do more to help those beset by war, persecution or economic duress. How they can do this without jeopardising their own democracies is one of the hardest questions facing liberals today.