When police approached 22-year-old Xiangyu Zhang at a gas station near his home in La Marque, Texas, last July, they found him sitting in his vehicle with two loaded rifles, including an AM-15 semiautomatic. Zhang, an undocumented immigrant from China, had threatened in an online chatroom for troubled military veterans to shoot schoolchildren, and in December he pleaded guilty to possessing a firearm while in the country without papers.

Zhang lived undocumented in the United States for two years, but he didn’t arrive illegally by walking across the border from Mexico. He entered legally, holding a temporary visa, and when the visa expired, Zhang stayed, becoming one of hundreds of thousands of foreign nationals who in recent years have overstayed visas and are now living in the country illegally.

President Donald Trump has argued that building a wall on the U.S.-Mexico border is the only way to stop illegal immigration. Without a wall, he said during a Jan. 10 visit to McAllen, Texas, there would be “death. A lot of death.”

But the fact is that more illegal immigration stems from visa overstays than illegal border crossings. In fiscal 2017, for instance, the most recent year for which both metrics are available, the Border Patrol apprehended just over 310,000 undocumented border crossers. But more than 700,000 foreigners overstayed visas (out of a possible 52.7 million people issued temporary visas for tourism, business, education, etc.), according to the Homeland Security Department, and more than 85 percent of them were thought still in the United States at the year’s close.

This hasn’t always been the case. For instance, the government is catching far fewer immigrants at the border today than throughout the 1990s and early 2000s, when apprehension totals regularly eclipsed 1 million. But a 2017 report by the nonpartisan Center for Migration Studies estimates the overstay population has outnumbered border-crossers every year since 2007.