There's a basic chicken-and-egg problem that has long bedeviled the U.S. immigration debate: What comes first, a secure border or effective reform?

For decades, "securing our borders" has been the rallying cry among many Americans concerned about illegal immigration.

The blueprint on immigration reform recently released by a bipartisan Senate group states that the path to legalized status for the estimated 11 million undocumented immigrants in the U.S. is "contingent upon our success in securing our borders and addressing visa overstays."

This sentiment is echoed by conservatives in the House and in many statehouses, particularly in the Southwest.

Unfortunately, this formulation has it exactly backward. To achieve a secure border, we must first have effective immigration reform.

Here's why: The United States has about 7,000 miles of land border, 95,000 miles of shoreline and thousands of airports. There's no way this vast expanse can ever be truly secure. In addition to illegal migrants, more than 50 million tourists arrive legally in the U.S. each year, some of whom overstay their visas.

The U.S. now spends about $18 billion a year on immigration control, more than on all other federal law enforcement agencies combined. The number of Border Patrol agents has doubled in recent years, reaching more than 21,000. The use of fencing, drones and other enforcement measures has been sharply upgraded.

Proponents of a strong border policy should be pleased by all this investment. Illegal (and legal) immigration from Mexico is at a historic low.

Yet there's another, arguably more compelling theory that explains the decline in illegal immigration: It's less a result of border security than economics.

What drives immigration from Mexico and points south is the imbalance of economic opportunity between there and here. In the past several years, with the U.S. economy struggling, that disparity has grown less stark, and illegal immigration has declined.

Of course, a prolonged recession isn't an optimal border- control strategy. It's a reminder, however, that immigration is essentially an economic phenomenon, which is why the U.S. border with our prosperous neighbor to the north, Canada, is far less trouble-prone.

Consequently, to control immigration we must address its economic roots, which are in the workplace, not at the border. The key to solving the problem is less the point of entry and more the point of hire.

Putting undocumented immigrants on a path to citizenship, modulating immigration flows to suit the needs of industry and agriculture, and at last holding employers fully accountable for the legal status of their employees are the most effective border-control strategies the U.S. could put in place. If there's no opportunity to be had in an illegal labor market, there will be few undocumented immigrants risking their lives to take advantage of it.

Thus the secret of immigration reform isn't first to secure the border before setting undocumented workers right with the law. It's the reverse: First create a regime that ensures the legal status of workers, with a regulated supply of migrants and sharp penalties for employers who violate the law.

The passions elicited by border politics make this approach difficult, in part because the demand for a lock on the nation's door seems so elemental. As Mexico and its neighbors grow more prosperous (with help from trade with the U.S. and Canada), the pressure on the border will decrease.

Meanwhile, the notion that the border can be made secure by law enforcement and technology alone is a fantasy. If we want to secure the border, Congress must first secure immigration reform.