In the 1840s, two republics contended for power in the southwestern quadrant of North America. In 1846, Mexico and the United States went to war over the issue. The United States inflicted a catastrophic defeat on Mexico. As prize of war, the United States got California, Nevada, Arizona, and New Mexico. Plus the Republic of Texas was allowed to join the United States. In 1853, the United States “purchased” the Gadsden Strip from a chastened Mexico.
Until 1924, the United States pursued a policy of “open borders.” That meant millions of Southern and Eastern Europeans could migrate to the USA. Big industrial cities in the East and the Midwest filled up. It also meant that there were no restriction on cross-border movements in the Southwest. Many Mexicans migrated northward toward the more dynamic economy of the United States.
Then came the Depression, which decreased wages in both Mexico and the United States. When the United States entered the Second World War, the American economy began a long boom. Between 1944 and 1966, 5 million “braceros” (Mexican temporary workers) came to the United States. Not all of them went back. By 1969 an estimated 540,000 illegal immigrants were working in the United States. That number increased markedly in the 1970s and 1980s. The economy of Mexico slumped far more than did that of the neighboring United States. By 1986, perhaps 3.2 million illegals were living in the United States. Mostly they were doing work that ordinary American citizens would not do. Hard, dirty, and for long hours.
In 1979, the Carter Administration (1977-1981) proposed building a border wall. In contrast, inn1986, the Reagan Administration supported an Immigration Reform and Control Act that granted amnesty to 2.7 million of the illegals.
Under the Bill Clinton and George W. Bush Administrations, it was back to “get tough.” From a dozen miles of fence between San Diego and Tijuana, the amount of fence grew to 560 miles after 9/11. In 2000, 1.6 million illegals were caught at or near the border. Then the Obama Administration added 137 miles of fence for a total of 697 miles of fence on the 1,954 mile-long Mexican-American border. Purportedly, improvements in the Mexican economy then reduced the migration of Mexicans. In 2017, the Border Control arrested only 310,000 illegals. So, triumph without a—full–wall!
The recent border “crisis” arises from different sources. Many Central American countries are collapsing under the weight of gang violence and mis-government. Whole families are migrating and presenting themselves as “refugees” at US points-of-entry.
However, people crossing the Sonoran desert is a peripheral issue in so far as illegal immigration is concerned. In 2017 alone, 700,000 people obtained US tourist visas and then over-stayed their visas. They just disappeared into the American hinterland. That is better than half of all the illegals.
Why should Central Americans get priority while Asians, Africans, and Muslims wait? “It’s a serious question.” https://www.youtube.com/watch?v=vInFuLgwR1U
 From 1882, the United States did try to limit immigration by Asians to the Pacific Coast.
 “A history of the southern border,” The Week, 8 February 2019, p. 11.
 The huge slump in the American economy—the “Great Recession”—may also have had something to do with it.
 This was basically the story with the 9/11 hijackers.