For three years and more the question of whether or not to build a wall along the U.S.-Mexican border has been a central issue of American politics.

Building a wall, and having Mexico pay for it, was a central commitment of candidate Donald Trump during the 2016 presidential campaign. The failure of Congress to appropriate funds for a wall, after Mexico refused to do so, was the catalyst for the longest government shutdown in American history only last month.

Even after more than $1 billion in new funds had been appropriated for border security, the imperative of building the wall was the pretext for President Trump’s Feb. 15 declaration of a state of national emergency, and the re-direction of over $6 billion in additional money to wall construction.

And the story continues today, amid a blizzard of litigation to restrain the president’s actions, coupled with preparations by both Democrats and Republicans to use the wall issue to their advantage in the 2020 presidential campaign.

Walls, of course, are not unknown in world history, as a tool for keeping enemies out or citizens in. The Chinese used them 2,000 years ago, like the East Germans during the Cold War. The Israelis continue to do so in their confrontation with surrounding Arab states. Walls, however, are an unusual tool for separating democratic populations, and rarely employed in American history before, except on a very limited geographic basis.

Not surprisingly, walls are a perplexing concept in mono-cultural island Japan, which long employed moats to ensure political distance and security within its castle towns, but much more rarely only walls.

One key to understanding America’s wall obsession today is grasping the socio-political transformation of the United States since globalization began to intensify during the mid-1970s.

The share of immigrants in America’s population has nearly tripled in recent years, from less than 5 percent in 1970 to around 14 percent today. The share of newcomers in America’s population is at its highest levels since the immigration surge before World War I, when the share of immigrants peaked at 14.7 percent in 1920.

Compared to the immigration surge of the last century, however, a much larger share of immigrants — roughly one-third of America’s overall total — is flowing from Latin America, across America’s southern border. Overall, America’s Hispanic population has accounted for fully half of U.S. national population growth since 2000.

This immigration surge and related ethnic transformation is coinciding with unbalanced economic growth and rising income inequality in the United States.

The American Rust Belt and Appalachian Mountains — the central locations of industries like steel, autos and coal negatively impacted by globalization and environmental restrictions — have little experience with minorities and are growing much more slowly than America as a whole.

Meanwhile, the share of national income flowing to the bottom half of America’s population, much of it concentrated in depressed regions, has fallen from around 20 percent in 1975 to less than 12 percent today.

America as a whole has benefited greatly, of course, from the diverse skills, insights, and willingness to work hard that its new immigrants have brought. Yet the dislocations, and the deepening challenge to America’s less fortunate, have been substantial.

Since the 1960s policy concern for civil rights injustice has been rising. Yet the challenges facing lower middle-class whites in the Rust Belt and the Appalachians have arguably been less often addressed, as the strength of the unions that represented them declined and the Democratic Party, also a traditional protector, shifted its emphasis from classical New Deal economic issues to civil rights and gender concerns.

Trump filled the gap in America’s political spectrum, appealing to the forgotten and frustrated in his populist 2016 campaign.

“Building the wall” was a symbolically central issue for him, as it spoke to the frustration of his blue-collar core constituency with competition from abroad, especially from the rising number of Hispanic immigrants, including an estimated 10 million undocumented residents.

With the prospect it raised of aggressive construction and building-materials spending, building the wall also had economic attractions. Trump’s narrow and unexpected triumph in Michigan, Wisconsin, Pennsylvania, and other states of the Rust Belt no doubt convinced him even further that the issue had strategic political importance for the future.

Over the first two years of his administration, Trump enjoyed Republican majorities in both houses of Congress, which pressed him strongly for tax cuts that were the central achievement of those early years.

Defeat in the November 2018 midterms, however, created a dramatically different political situation. It made reviving the wall issue imperative for Trump, even as it gave Democrats the leverage, through their majority in the House of Representatives, to complicate its construction.

Confronting a potentially turbulent re-election campaign, made more complex by “Russia-gate” and a maze of other encroaching scandals, Trump needed to rally his core constituents. And the Democrats, pressed by their own diverse coalition and strong Hispanic component, mobilized rapidly in the courts and Congress to stop him.

The wall obsession in American politics, so perplexing to the outside world, thus shows the prospect of continuing for months and even years — very possibly through the presidential campaign of 2020.

Kent E. Calder is director of the Reischauer Center for East Asian Studies at SAIS/Johns Hopkins University in Washington.