Samantha Sais / Reuters

Periodically, a journalist or policy maker informs us that Americans are panicked about immigration, and suggests that the United States should engineer the demographics of its population through immigration policy. Writing in The Atlantic, for example, David Frum argues that the U.S. should slash legal-immigration levels and restrict family reunification in favor of selecting immigrants based on skills, moves he believes would have positive economic and social consequences.

But in the past, when the government has tried to control demographics with immigration policy, it hasn’t gotten what it wished for.

Consider the country’s response to the wave of immigration in the early 20th century, to which Frum compares our current wave, and which represents the largest episode of mass migration the United States has ever experienced in proportion to its population. People in power thought it was harmful to let so many minimally educated poor, nonwhite immigrants into the country, into American neighborhoods, schools, and eventually even families. So Congress passed the first version of “comprehensive immigration reform,” the 1924 Johnson-Reed Act.

The act used the 1890 census to create benchmarks for allowing immigration only from countries that had sent early settlers to the United States (primarily England) and for restricting immigration from European nations whose residents were considered racially inferior and had not been part of the country’s original demographics, for example, Italy, Poland, Germany, Scandinavian nations, and even Ireland.

The law was supposed to reestablish a population similar to the settlers—but that’s not what happened. Its authors failed to recognize the consequences of cutting off most immigration, and they therefore omitted provisions to restrict immigration from the Americas. As European immigration plummeted, undocumented immigration from Mexico ticked upward to meet the demand for cheap labor. Brutally exploitive temporary-work provisions, such as the bracero program and the H-2 program to supply sugar-cane farmers with cutters, exacerbated this effect. By 1960, the population of the United States that had been born in Mexico and other Latin American countries had increased to 2.5 times its former size, despite the fact that the total population of foreign-born persons had gone down by 40 percent. Instead of engineering a population of highly educated, northwestern Europeans, the authors of the legislation created new immigrant communities that persist to this day.

This restrictionist immigration law was a source of embarrassment during the Cold War and was phased out starting in 1952. It was ultimately replaced with the 1965 Hart-Celler Act, which opened immigration up both numerically and with respect to countries of origin. Hart-Celler remains the framework for immigration policy today.

One important provision of the law that remains intact, and that is a source of frustration for Frum and many contemporary immigration skeptics, is the prioritization of family reunification as a basis for acquiring a visa to come to the United States. What they rarely mention is that the legislators who designed family reunification did not intend to transform the country, and in fact sought the reverse. They thought family reunification would solidify existing immigrant demographics by encouraging people of European origin to sponsor other European-origin immigrants. Their presumption made sense, but it was not borne out. The country’s demographics shifted and family reunification ended up being the pathway to entry for large numbers of immigrants from Mexico and the Dominican Republic, as well as from China, Vietnam, and India, among others.

These experiences didn’t stop legislators from trying again to make the country’s demographics match their desires. In 1988, the predecessor to the diversity lottery was enacted by a group of legislators who took a special interest in resuscitating Irish and Italian immigration. But like the 1924 quotas and 1965’s family-reunification provisions, the effect of the diversity lottery was the opposite of what its champions intended. It quickly became a program that brings mostly nonwhite people to the United States from a vast array of countries. As of 2017, Asian and African countries accounted for more than 70 percent of all diversity-lottery visas issued.

Above all other unintended consequences of immigration engineering has been the flourishing of undocumented immigration. Before the United States began to enforce the 1924 law, there really was no such thing as undocumented immigration as we know it. It was invented by legislators who wanted to close the border. And the vast, costly deportation apparatus that has been built as a result has created new problems, too.

In the 1980s, the gang MS-13 rose to prominence in the United States, particularly in Los Angeles and the city’s prisons. The largest proportion of its members were Salvadoran. Under President Bill Clinton, a special effort was launched to return gang members to their country of origin, to insulate the U.S. from their violence. Instead, it exported MS-13 to El Salvador, where it has metastasized and spread throughout Central America, causing people desperate to flee to—you guessed it—seek asylum in the United States.

Policy outcomes like the ones I have described didn’t happen because past lawmakers were less intelligent or less informed than today’s. They happened because population-level predictions, especially about things such as human movement, are often wrong. We might think we’re savvier about how to design a population than we were in 1924, but nothing Congress has done in the interim suggests that’s the case.

Even eliminating family-reunification visas, as Frum proposes, could trigger as many problems as its detractors claim the program causes. Family reunification is a classic example of a conservative-friendly policy because it outsources many costs of immigration to sponsoring families. I do not just refer to the fact that sponsors must meet income requirements sufficient to provide for the immigrants in case of need, but also to the fact that they absorb the costs of integration through organic social networks. In skills- and points-based systems, countries provide integration resources to help new arrivals find homes, navigate employment, learn the language, and perform the other hard work of integration. Canada, which uses a points-based immigration system and also admits refugees, spent 1.2 billion Canadian dollars on immigrant integration in its 2016–17 fiscal year.

There are costs created when poor immigrants enter the country. But there are also costs to keeping them out or replacing them with “better” immigrants. Losing the resources of families who sponsor immigrants is just one example. We also don’t know what price we will pay for restricting legal immigration, skimming the best-educated members of other countries, drastically reducing remittances sent to poor and unstable countries, and myriad other very likely outcomes of transforming our immigration system.

Immigration restrictionists justify their position by pointing to nativist-populist anger, a wildly inegalitarian and under-resourced public-education system, unplanned growth, our outsize contributions to climate change, an inadequate social-welfare and health-care system, and the uncertainty that comes with a rapidly changing economy. If we want to tackle those challenges, we should do so head-on. Reducing and changing the immigrant population won’t solve these disparate and complicated problems, but it will likely create new ones.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.