When Donald Trump was reaching adulthood in the mid-1960s, the United States was a less diverse place. By 1970, the share of the population born overseas had shrunk to 4.7 percent, the slimmest on record. Only about 0.4 percent of the population had been born in Mexico.

The core constituency of Mr. Trump, the Republican front-runner — white, older voters like him who are more likely to believe that immigrants take Americans’ jobs, housing and health care than accept that they contribute to the economy — came of age largely at that stage in history, from the 1950s through the early 1970s.

“It was a unique period of rapid economic growth, when the children and grandchildren of Europeans were blending into a homogeneous mass,” said Douglas S. Massey, a Princeton sociologist. “That world is gone.”

This transformation provides the most convincing explanation of the runaway popularity of Mr. Trump’s proposition to kick out the estimated 11 million immigrants living illegally in the United States today and close the door to future migrants with a 2,000-mile border wall.

To these voters, a country where 13 percent of the population was born abroad and where 17 percent identify as Latino is a scary place. But what is most paradoxical about that belief is that Mr. Trump’s central proposition — that illegal immigration into the United States remains a critical problem — is actually wrong. Mr. Trump, as Mr. Massey succinctly put it, “is beating a dead horse.”

Illegal immigration could rebound as the American economy recovers further. But Mr. Massey and others argue that a more powerful force is pulling in the other direction: demographics, which has significantly shrunk the population of Mexicans interested in crossing the border.

“I don’t see Mexicans coming back in any great number,” said Pia M. Orrenius, an economist at the Federal Reserve Bank of Dallas who has studied patterns of illegal immigration. “The cohorts of working-age men are much diminished, so you don’t have the push.”

Indeed, 15- to 24-year-olds, those most likely to consider going north, shrank to 18 percent of the Mexican population in 2015 from 22 percent in 1990. They are expected to drop to 16 percent of the population in 2025.

The great migration boom from Mexico from the 1980s through the first half of the last decade was the consequence of “a perfect storm,” said Gordon Hanson, an economics professor at the University of California, San Diego.

Even as the United States experienced solid growth through what came to be known as the Great Moderation, Mexico suffered three currency crises in 13 years. And while growth in the American-born labor supply slowed after the last of the baby boomers entered the work force, Mexico’s working-age population was still expanding fast.

Perhaps the strangest thing about Mr. Trump’s appeal is that his main weapon — the border wall — is already well established. It has proved, at best, pretty much irrelevant. At worst, it backfired badly.

Border Patrol personnel have doubled since 2004, to more than 21,000. More than 650 miles of fencing has been built, festooned with sensors and backed up by drones.

These days, immigration enforcement takes up half the nation’s entire law enforcement budget. The border patrol’s budget alone has increased more than tenfold since 1970, to nearly $4 billion.

Recent research by Professor Hanson, Scott Borger of the Department of Homeland Security and Bryan Roberts of Econometrica, based on data from the Department of Homeland Security, suggests that the most recent step-up of border enforcement may have had a bigger effect than previous efforts, accounting for one-third of the downturn in illegal immigration from 2003 to 2010.

Yet the expansive border buildup has also had perverse effects, promoting the very pattern it was supposedly intended to curb.

“Enforcement increases the cost of crossing the border but also increases the payoff, because it raises the wage of those who get through,” because there are fewer of them, Ms. Orrenius noted. “So you can return to the market equilibrium that you had.”

Soon-to-be-published research by Professor Massey, Karen A. Pren of Princeton and Jorge Durand of the University of Guadalajara in Mexico, based on tens of thousands of interviews with migrants from nearly 150 Mexican communities, concluded that the odds of a prospective immigrant ultimately making it illegally into the United States remained above 95 percent until 2008.

The probability declined to 75 percent after 2008, but by then economic and demographic forces had pushed net illegal immigration down to about zero.

The border buildup did change immigration patterns, Professor Massey argued, but mostly in undesired ways. It didn’t stop immigrants from making it in. But the rising cost of entry to the United States — the higher smugglers’ fees, the greater odds of dying on the way — ensured that those who made it stayed in the United States.

What was once a pendular flow of Mexican men coming north to do seasonal work in a handful of states and returning to Mexico in the winter became a permanent community of full-fledged families that settled across the 48 contiguous states.

Mr. Trump could blame the browning of America at least in part on the wall. In a cheeky bit of counterfactual analysis, the three researchers estimated that the tightening of border enforcement since 1986 actually added four million people to the population of immigrants living illegally in the United States in 2010.

Nostalgia, of course, has no place for analysis. Analytical quibbles are unlikely to sway Mr. Trump or his followers.

They might even take comfort from examples in history of nearly impregnable walls. East Germany managed to close itself off from the West from 1961 to 1989 with an effectiveness of 95 percent.

It was expensive, though. It took nearly 30,000 guards to defend a boundary less than half the length of the Mexico-United States border. Border guards used land mines and shot to kill. They got help from the Stasi, monitoring every aspect of East Germans’ lives.

This seems like a high price to pay to stop a trickle of illegal immigrants that is falling on its own to zero.

Correction:

An earlier version of this column misidentified the entity East Germany used 30,000 border guards to defend against along a boundary less than half the length of the Mexico-United States border. It was West Germany, not West Berlin.