On Wednesday, a day after the deadly van attack in New York City, President Donald Trump used the tragedy to call for the elimination of a small but significant immigration program. After calling the suspect, Sayfullo Saipov, an “animal,” Trump said he would ask Congress to shut down the method through which Saipov entered the United States from his native Uzbekistan.

“I am today starting the process of terminating the diversity-lottery program,” Trump said in a meeting. Trump, though, cannot do away with it on his own; he needs Congress’s approval. “Diversity lottery. Sounds nice, it’s not good. Not good. It hasn’t been good, and we’ve been against it,” he told reporters.

He also called for an end to “chain migration”—as Trump derisively calls it when a US citizen or green-card holder sponsors a family member’s visa—and to replace the current system with “a merit-based program, where people come into our country based on merit.”

That’s a lot of immigration politi-jargon, and doing away with “chain migration” would not have kept Saipov out of the country. (Neither, for that matter, would the enforcement of any iteration of Trump’s Muslim bans.) But cutting out the diversity-visa lottery would have kept Saipov from entering legally.

All of Trump’s anti-immigration goals are included in the RAISE Act, a bill introduced earlier this year by Senators Tom Cotton (R-AR) and David Perdue (R-GA). This legislation, which the Trump administration backs, would likely slash in half the number of people allowed to immigrate to the United States. The bill would cut off the pipelines that have made it possible for Latinos and Asians to be the fastest-growing segments of the US population. At its core, the RAISE Act is the expression of white existential desperation triggered by the country’s swiftly changing demographics. The Halloween-afternoon attack just gave the president a handy excuse to return to his old refrain. Among the proposals in the RAISE Act is a call to eliminate the diversity-lottery visa.

Only 50,000 of these visas are awarded every year, and the program was designed to mix up the pool of legal immigrants to this country. Only those who were born in countries outside of the top immigrant-sending countries may apply. (People born in Canada? India? China? Mexico? The Philippines? The diversity visa is not for them.) From there, the eligibility requirements are low: Anyone with the equivalent of a high-school diploma may enter. And because of that, it’s a perennially popular lottery. A decade ago, 9 million people entered the lottery. And it’s only gotten more popular. In 2015, more than 15 million people entered. Those who are awarded these visas must clear the same screening process that all immigrants do: criminal background checks, biometric data gathering, and fingerprinting.

Those who entered on the visa made up just 3 percent of the 1.38 million legal immigrants who moved to the United States in 2015. In order to understand the true significance of the program, though, one must understand the larger US system of legal immigration. Today there are, in most cases, just two ways to immigrate to the country legally: to reunify with a US citizen or green-card-holding family member or to work a highly skilled job with the sponsorship of an employer. The professional avenues are narrow too. We’re talking about a select bunch: Most who come through professional avenues are scientists, corporate executives, software engineers, athletes.

Because of this, and the fact that the diversity visa is awarded on an actual lottery basis, it represents values often associated with the stereotypical American dream: chance, luck, opportunity, egalitarianism, diversity. The visa lottery is a rare opportunity for those who are not already well-educated, wealthy, or well-connected to immigrate legally to the United States.

Incidentally, because of the constraints of the legal immigration system and the eligibility requirements of the diversity-visa lottery, the program has become a key avenue for African immigrants to get here. Ironically, the program that Trump now wants to remove in order to cut off a valve feeding non-white newcomers into the United States was in its inception designed to alleviate concerns about non-white newcomers entering.

In the late 1980s, a few decades on from the pivotal enactment of the 1965 Immigration Act, which opened the doors for Asian and Latino immigrants, the country was starting to feel some unease about what it had done. Lawmakers, responding to that anxiety, sought to create new avenues for legal immigration for non-Asian and Latinos.

As Carly Goodman with the American Friends Service Committee wrote for The Washington Post earlier this year: “Despite its name, the motivation behind the program came less from a desire to diversify the immigrant population than to whiten it.”

The program was conceived as a way to address the complaints of some of the recent Irish undocumented immigrants who found themselves locked out without the fancy credentials or family connections required to immigrate legally. “Thus, when Congress created the Diversity Visa lottery in 1990, it did so mostly to benefit immigrants from European countries who had historically sent many immigrants but had recently sent few, like Ireland,” Goodman wrote. “But to make the program appear unbiased, they also included countries that had never sent many immigrants to the US.”

That little historical tidbit provides one of the most important lessons about US immigration policy. It’s almost never been inspired by the oft-touted ideals of diversity, inclusion, and openness. Instead, it’s nearly always driven by the goal of tailoring the racial demographics of the United States toward a whiter, richer future. On Wednesday, national-security concerns were a convenient pretext for a return to that most long-standing of American ideals.