President Obama’s recent request for billions of dollars to address the surge in unaccompanied children across the U.S.-Mexico border has ignited fierce criticism. Republicans such as Sen. Ted Cruz of Texas blame Obama’s supposedly lax enforcement policies. Democrats blame the surge on a humanitarian crisis in Central America.

While both narratives bear some truth, both miss how our immigration restrictions and border enforcement have created the current mess.

Migration from Central America and Mexico used to be circular. Migrants would come for a season or a few years to work, move back home, then return to the USA when there was more work. This reigned from the 1920s to 1986, when Congress passed the more restrictive Immigration Reform and Control Act.

Before 1986, when circular migration was in effect, 60% of unauthorized immigrants on their first trip here would eventually settle back in their home countries rather than in the United States, and 80% of undocumented immigrants who came back on a second trip eventually returned home.

Since 1986, the rate of return for first-time border crossers has fallen to almost zero. The return rate of second-time crossers has fallen to a mere 30%. What happened? In the mid-1980s, the government began spending massive resources to stop unauthorized immigrants from coming in the first place. By trying to keep them out, increases in border security locked them in.

There are more Border Patrol agents chasing fewer new undocumented immigrants than at almost anytime in our history. Since 1992, the number of Border Patrol agents has increased fivefold. Apprehensions this year, a proxy measure for the number of illegal crossers, will likely be about a quarter of the 2000 peak of 1.7 million.

Border security raised the smuggling price of migrating from about $700 in the early 1990s up to $7,500 this year. That greater price means migrants would have to work longer in the USA to cover their costs, making the cost of leaving and returning prohibitive. Many unauthorized migrants, faced with the higher costs of crossing the border, decided to stay permanently, another unintended consequence of U.S. policies aimed at restricting illegal immigration.

If the parents cannot move back and forth, their children will come north. The increase in unlawful immigrant workers from Central America is being followed by their children coming north to join them. According to a United Nations survey of unaccompanied minor migrants from 2011 to 2013, 41% of the Central American children have at least one parent in the United States.

If those Central American workers could have come here legally on guest-worker visas, they would be able to move back and forth legally, removing the reason so many minors have come alone to join them.

The laws of economics cannot be repealed. So long as the U.S. is a prosperous country and American employers and consumers want to employ foreign workers, they will come regardless of the laws. More aggressive border enforcement and immigration restrictions do stop some unlawful immigration, but the unintended consequence is a growing permanent population of illegal migrants desperate to be reunited with their children.