Niall Ferguson is the Milbank Family senior fellow at the Hoover Institution, Stanford

As so often, South Park saw it coming. In “The Last of the Meheecans” – which first aired in October, 2011 – the obnoxious Eric Cartman joins the U.S. Border Patrol, only to find himself facing the wrong way as hordes of disillusioned Mexican workers seek to flee the economically depressed United States back to Mexico.

Undaunted, Cartman makes it his business to stop them leaving. After all, without Mexican labour, the U.S. economy would grind to a halt.

Very often, the Trump presidency feels as if it’s being written by Trey Parker and Matt Stone, the comic geniuses who created South Park more than 20 years ago. In this week’s episode, Donald Trump/Cartman shuts down the federal government in retaliation for the Democratic Party’s leaders’ refusal to approve the border wall he campaigned for in 2016.

The net result is that the government employees responsible for controlling the vastly larger flow of people into the United States through airports don’t get paid. Desperate to end the shutdown, for which he is being blamed, Trumpman declares a national emergency under legislation that permits redirection of Department of Defense construction funds, provided it’s for the purpose of military defense.

Trumpman’s attempt to use DoD money to build his wall is challenged and struck down in the courts, but he goes ahead anyway, only to run into a shortage of construction workers. The episode ends with the arrival of the “caravan” of Central American asylum-seekers (last seen in the November mid-terms episode), who gratefully accept jobs to build Trumpman’s wall.

Few, if any, commentators have had positive things to say about this episode of South Lawn (yes, that’s the area behind the White House where Marine One, the presidential helicopter, takes off and lands). On Morning Joe, Steven Rattner offered a few killer facts. First, as in South Park, the number of Mexicans seeking to cross the border illegally has plunged 92 per cent since 2000. The majority of people apprehended at the border these days are from dysfunctional Central American countries such as Honduras, El Salvador and Guatemala, and most are now families or unaccompanied children.

Sure. But does that make Nancy Pelosi right to call extending the existing barriers along the U.S.-Mexican border an “immorality”? Should we agree with newly elected Congresswoman Alexandria Ocasio-Cortez that Immigration and Customs Enforcement has “systematically violated human rights” on the border, whereas people trying to cross the border are “acting more in an American tradition than this President is right now"?

Implicitly – and at times explicitly – the American left is arguing for open borders. You don’t have to be a Trump supporter to regard this as folly.The historian Charles Maier, my former colleague at Harvard, is the personification of the old, decent, cerebral liberalism of the northeastern seaboard. But, as he argues in his outstanding book Once Within Borders, “borders are more than just barriers; for some they guarantee community and belonging.”

Since ancient times walls have principally served to keep citizens or subjects safe by excluding all kinds of invader. Jail walls aside, walls to keep people in, rather than out, have been less common. They came to the fore in the Cold War, when totalitarian regimes from Berlin to Pyongyang were forced to fence in their populations to prevent them from voting with their feet.Those sections of the Iron Curtain were what gave walls such a bad name in our time. It was not only Ronald Reagan who condemned them. Western leaders from Churchill to the present Pope have repeatedly inveighed against political barriers. And let’s not forget Pink Floyd.

The notion of a world sans frontières was always a hopelessly naive one. It was easy to be against walls when they were imprisoning East Germans and North Koreans. It is a lot harder when the world’s most objectionable regimes make almost no effort to contain their citizens behind borders.

All over the world, people are on the move from messed-up countries – and there is remarkably little to stop them. According to a Gallup survey in 2017, more than 700 million adults around the world would like to move permanently to another country. Of that vast number, more than a fifth (21 per cent) say their first choice would be to move to the United States. The proportion who name an European Union country as their dream home is higher: 23 per cent.

Yet, recent polling by the Pew Research Center points to an equal and opposite resistance to mass migration by the people in the preferred destinations. Across 27 countries, 45 per cent of those surveyed said fewer or no immigrants should be allowed to move to their country, while 36 per cent said they wanted about the same number of immigrants. Only 14 per cent said their countries should take in more immigrants. For the United States, the proportion wanting more was 24 per cent – only Spaniards are more welcoming – but that’s still less than a quarter.

Cartman rarely has the last laugh in South Park. But the denouement may be different in South Lawn. If the choice is between open borders or defensive walls, then history suggests that walls – and those who build them – will win.