LESS than ten miles separate two rooms in McAllen, a modest, low-slung city on the Mexican border. The first is Ursula, an immense warehouse which squats behind a high brick wall, almost invisible from the street. It is the largest immigration-processing facility in America, and holds children taken from their parents under a policy that President Donald Trump’s administration initiated in April and then ordered stopped last week. Inside the facility, children lie on mats beneath bright lights that never go out, wrapped in Mylar blankets, caged behind chain-link fences.

Nine miles north, clad in a modest stucco, is the second building—the Catholic Charities Humanitarian Respite Centre, where migrants who have been released from detention can rest, shower, change clothes and have a hot meal before their onward journey further into the United States. Most have travelled for weeks from Central America, though some journeys are more arduous than others. Brenda Riojas, a cheery and tireless spokeswoman for the Diocese of Brownsville, which runs the centre, says that a woman arrived recently with a ten-day-old baby: she had given birth in the Mexican mountains during her northward trek. On one recent Wednesday afternoon, young men huddled around a television watching the World Cup, while parents tended to their children and filled out forms. A smattering of Texans arrived with boxes of clothes to donate.

If you are a liberal, you probably view what is happening in the first building as unbearably cruel and what is happening in the second as decent and just. If you support the president, you probably view what is happening in the first building as regrettable but necessary and what is happening in the second as naive and perhaps dangerous: after all, if you treat them kindly then more will come.

More than any other single issue, attitudes towards immigration define Mr Trump’s base. Some immigration restrictionists use clinical language, arguing that reducing levels of immigration would be better for American workers and immigrants already in America. Not Mr Trump. To him, Mexico is sending “rapists” and members of MS-13, a hyper-violent gang, across the border. (Stephanie Leutert, who directs the Mexico Security Initiative at the University of Texas, points out that his own government’s data show that MS-13, members made up 0.075% of the total number of migrants crossing the southern border in the 2017 fiscal year.) The president discusses immigration in the vocabulary of a pest-controller. Everything suggests that he intends to make the “infestation” of immigrants a central issue in the mid-terms, despite the revulsion at his policy of sundering families to deter future migrants.

The traverse in reverse

America’s immigration system offers something to displease everyone. People such as Jeff Sessions and Stephen Miller—the attorney-general and his funereal former aide, now a policy adviser to Mr Trump—think it far too permissive. Employers find it rigid and unresponsive to their needs. The asylum process is, in the words of a case-manager in Houston, “set up so people fail.” This is what happens when decades of congressional kludges are piled on top of each other.

The Supreme Court did not deem regulating immigration to be a federal responsibility until 1875. That year, awash in concerns over the prevalence of Chinese workers, especially in California, Congress passed the Page Act, which banned virtually all Asian women from entering America. The Chinese Exclusion Act, which barred Chinese immigrants, followed seven years later. In 1882 Congress passed the Immigration Act, which put the treasury secretary in charge of immigration control, levied a tax on every non-citizen who arrived at American ports and barred all foreign convicts—“except those convicted of political offences”. Naturalisation and citizenship were tightly restricted, often racially; but immigration, by and large, was not. Of the immigrants who arrived in the great wave between 1890 and 1930, more than one-quarter were never naturalised.

By 1910 13.5m immigrants lived in America (nearly 15% of the total population), resulting in a restrictionist backlash. The Immigration Act of 1917 prohibited immigration from Asia, with an exception for the Philippines, which America then ruled, and Japan. It also required that immigrants pass a literacy test, and barred “undesirables”, a category that included “idiots, imbeciles, epileptics…polygamists and anarchists”.

America did not set permanent numerical limits on immigration until the Johnson-Reed Act of 1924, which used a quota system to govern entry. This system provided visas to up to 2% of the number of foreign-born people of each nationality present at the time of the 1890 census. In effect, this restricted immigration to Europeans, and was especially favourable to Britons and other western Europeans and unfavourable to southern and eastern Europeans, who at the time the act was signed comprised the bulk of newly arrived immigrants.

Congress abolished the national-origins quota system in 1965, with legislation that favoured skilled workers and immediate family members of immigrants already in America. In the civil-rights era, having an immigration system that used national origins—in effect, race—as its determining factor was seen as discriminatory.

Ted Kennedy, who championed the bill after the assassination of his brother John, promised that “it will not upset the ethnic mix of our society.” Yet the new measure made America vastly more diverse. Muzaffar Chishti, an attorney with the Migration Policy Institute, a think-tank, argues that the bill’s backers assumed it would increase immigration from southern Europe—particularly Greeks, Portuguese and Italians. In fact, immigration soared from newly independent countries in Asia, and nearby ones in Latin America. In 1960, America was home to 9.7m immigrants, 75% of whom were European. By 2016 that number had soared to 43.7m—13.5% of the total population—89% of whom were non-European. In recent years immigrant populations have spread beyond the traditional hubs, such as California and New York. In 1990, for instance, 173,100 immigrants lived in Georgia, accounting for 3% of its population; by 2016 those numbers had risen to 1m and 10%. Many of the states that saw the steepest rises in share of immigrant population voted for Mr Trump in 2016. A repeated failure to legislate, which gave the impression that immigration was out of control, helped pave the way for his victory. The last significant legislative attempt to address illegal immigration came in 1986. The Immigration Reform and Control Act legalised 2.7m undocumented immigrants, tightened border security and punished employers who knowingly hired undocumented workers. It was supposed to halt illegal immigration. However, thanks to ineffective employer sanctions (“knowingly” hides many sins), continued demand for labour and the simple fact of a long, unsecurable border with what was then a poor and dysfunctional country, the opposite happened. That gave hardliners a potent answer to every subsequent fix: offer undocumented immigrants “amnesty”—a crude term for a tortuous and selectively granted path out of the shadows—and more will come. Three similar subsequent attempts failed, for similar reasons. The Comprehensive Immigration Reform Act of 2006 included provisions to enhance border security, establish a new temporary guest-worker programme and provide a path to citizenship for some undocumented immigrants. Co-sponsored by five Republicans and one Democrat, it passed the Senate, but the House preferred a different bill—one that enhanced border security, limited judicial review for undocumented immigrants, increased criminal penalties related to border crossings, strengthened employer verification requirements and neither expanded guest-worker visas nor legalised any undocumented immigrants.

Congress, with the support of George W. Bush, then the (Republican) president, made another run at immigration reform in 2007, introducing a bill that would have enhanced border security, provided a path to citizenship for some undocumented immigrants and ended family reunification, leaving only the spouse and children of a green-card holder eligible to legally immigrate to America. It failed in the Senate.

A similar measure in 2013 passed the Senate, with the votes of all 52 Democratic senators, but died in the Republican-dominated House, which appeared interested only in enforcement. Shortly before that bill died, President Barack Obama enacted Deferred Action for Childhood Arrivals (DACA) with an executive order. This allowed undocumented immigrants brought to America as children who enrolled in or graduated from school, university or the armed forces and had no criminal record temporary, renewable legal working papers. Mr Trump tried to end DACA last September.

If there were ever a perfect moment for immigration reform, this is it. The border now has more fencing and police than it did in 2000, when crossings were at their peak. Then virtually all migrants were Mexicans. Today, with Mexico’s economy and birth rate both stable, nearly half come from Honduras, Guatemala and El Salvador—weak states wracked by gang violence—enduring a costly and treacherous journey north. As of early 2017, America was experiencing a net outflow of undocumented Mexican migrants and a decline in its Mexican-born population.

Yet Mr Trump appears uninterested, preferring the political gains he makes from fulminating over the system’s failings than doing the hard work of trying to fix them. Mr Trump has remade his party, whose presidential candidates once competed to outdo each other in compassion towards poor migrants, in his own image. Republicans have no compelling electoral interest in fixing the nation’s immigration laws. More than 60% of those who voted for the president in 2016 thought it was either “very” or “fairly” important to be born in America in order to be considered truly American. Good luck persuading them to grant legal status to 11m people born outside the land of the free.

The political backlash against immigration is therefore peaking at a time when the number of migrants is receding. In the 2017 fiscal year, apprehensions along the southern border hit their lowest level since 1971.

As the tide goes out, a big population of undocumented migrants is being left behind. After peaking in 2007 at around 12.2m people, the undocumented population in 2016 stood at 11.3m, comprising just over 25% of all the country’s immigrants, and about 5% of the American workforce.

A large number of current border-crossers claim asylum in America: about 300,000 central Americans did so in 2017. Many northern European countries put asylum-seekers in reception centres, where they are fed, sheltered and are free to come and go. Life outside these centres would be harder for migrants there than it is inside. America’s newest facility for migrant children, by contrast, is a tent city in Tornillo, Texas, where temperatures can exceed 40°c (104°f).

Once someone seeking asylum is released in Texas, they can melt away into the grey labour market or move to a sanctuary city (where local police limit co-operation with federal immigration authorities) and, many fear, skip their hearings at an immigration court. The federal government has tried to prevent this by turning police officers across the country into immigration officials, under a programme called Secure Communities, but it does not have the power to compel local police chiefs to comply. The Trump administration’s policy of ending what it calls “catch and release” will probably require a vast increase in the number of border-crossers who are locked up in facilities that look an awful lot like prisons.

There are alternatives to this. A pilot programme that the Department of Homeland Security (DHS) ran from 2015 until the administration killed it in 2017 placed immigrant families under the supervision of social workers, who helped them find housing and navigate the immigration bureaucracy. More than 90% of participants reportedly showed up to all of their check-ins and court hearings. Another programme used ankle monitors to keep tabs on immigrants; this too showed a high compliance rate. Both methods are cheaper than detention centres; neither fits the mood of today’s Republican Party.

Duck and cover

Over the past weeks Republicans in the House have engaged in a pointless political theatre, voting on a pair of immigration bills: a hardline measure and a “compromise” bill (the compromise being between moderate and hardline Republicans, not between the two parties) backed by Paul Ryan, the outgoing House speaker. Both failed, though more Republicans backed the hardline bill than Mr Ryan’s. The Senate would not have taken up whatever measure passed, and Mr Trump has repeatedly undermined negotiations by, for instance, tweeting that Republicans should “stop wasting their time” on immigration bills before the mid-terms.

And in a narrow sense, he may be right. His approval ratings among Republicans remain high, while Democrats have struggled to muster an effective response beyond (admittedly justified) outrage at Mr Trump’s actions. That approach failed in 2016 and it risks failing again in 2018 and beyond. Part of that is circumstance. Enforcement is an essential part of any comprehensive fix to immigration, but as one Democratic strategist says, “in moments when right-wing populism is ascendant, nuance gets lost…it’s hard to talk about toughness when children are being ripped from their parents’ arms.” Some on the party’s left flank talk as though any enforcement of immigration law is inherently racist. It is not, of course, but two years of Mr Trump’s racially tinged comments about immigrants have left nerves raw.

The window for comprehensive immigration reform may now have shut. One thing that slowed the flow of refugees from Central America over the past few years was co-operation from Mexico. But Mr Trump has torpedoed America’s relationship with its southern neighbour, which now appears poised to elect its own populist firebrand, Andrés Manuel López Obrador. Perhaps the two will get along famously. Or perhaps Mr López Obrador will decide he sees no reason to make things easier for a president who treats his country and countrymen disrespectfully, and allow Central Americans free passage to Mexico’s northern border.

The current administration’s policy is built on a fantasy: that 11m people can be deported against their will. It is that, not the people arriving at the southern border, that makes America’s immigration system unique in the rich world. People will die of old age in America before they ever acquire the legal right to live in America. This is an extraordinary failure to govern.