Writing at CATO, David Bier has an excellent article on illegal immigration. The whole thing is worth a read, but there are two particular points I want to focus on:
Border patrols and deportations were increased to stop the flow of unauthorized immigrants, but they had little effect. “I’ve no doubt whatever that the man finally deported is back here,” the Assistant Secretary of Labor told the Times. “Easily 50 per cent of them return.” In July 1929, Congress gave in and provided “amnesty” or citizenship to the undocumented immigrants. Then, the Great Depression dried up demand for workers, temporarily resolving the issue. When the economy finally picked up again following World War II, illegal immigration returned.
Illegal immigration finally nosedived after the housing bubble burst, and the illegal population shrunk from 2007 to 2014.
Lest I be accused of cherry-picking, the trend of immigration tapering off during recessions and increasing during booms holds throughout history (obviously, the more severe the recession, the more pronounced the decline in immigration).
This pattern is exactly what one would expect: when the economy is growing, labor demand is growing, and the wage rate (the cost of labor) is increasing, more supply (immigration) is attracted to the market. When the economy is shrinking, labor demand is shrinking, and thus the wage rate is falling, supply is repulsed from the market. Just a simple analysis of the labor market.