Passions rise, tempers flare, and sooner or later someone says: Why don't they just come here legally, the way my grandparents did?

In any debate about illegal immigration, that argument, with its implied moral distinction between prior generations of purportedly law-abiding immigrants, and anyone here illegally now, invariably comes up.

But although many people think their ancestors came legally, says immigration historian Mae Ngai, most families can't know that with certainty. And the criteria for admission to the United States have changed so much since the late 19th and early 20th centuries that most comparisons of then to now are like apples to oranges.

"Before World War I, we had virtually open borders," said Ngai, a professor of Asian American studies at Columbia University and author of the 2004 book Impossible Subjects: Illegal Aliens and the Making of Modern America. "You didn't need a passport. You didn't need a visa. There was no such thing as a green card. If you showed up at Ellis Island, walked without a limp, had money in your pocket, and passed a very simple [IQ] test in your own language, you were admitted."

A rapidly expanding America needed labor. One million immigrants were let in annually. Just 1 percent were turned away, typically because they failed the medical or mental test.

As Italians, Greeks, Russians, Poles, Hungarians, and other newcomers began showing up, said Ngai, nativists leveled criticisms that "sounded much like the ones that you hear today: 'They don't speak English. They don't assimilate. They're darker. They're criminals. They have diseases.' "

In that context, Congress passed the National Origins Act of 1924, which for the first time put a limit on how many people could come into the country. It established visa requirements and a quota of 150,000 admissions a  year. It continued the nation's blanket ban on Asians, and drastically limited certain other nationalities.

"When people say their ancestors came legally, if they came before 1924, everybody was legal," said Ngai. "It wasn't a choice they had to make. After 1924, if you couldn't get a visa because your country's quota was filled, many came without documents. They sneaked in."

Stanford University history professor Richard White said he was researching Remembering Ahanagran, his book about his family's immigrant past, when he discovered that his maternal grandfather, an Irishman, had entered the U.S. illegally from Canada in 1924 because he could not get a visa that year under the new quota laws. His grandfather failed in his first attempt, when he walked across a bridge into Detroit, got caught by U.S. customs officers, and was deported.

From Canada, the grandfather called his brother-in-law, a Chicago policeman, who came to Canada and met him there, White said. The pair then walked to Detroit, But this time the brother-in-law, who was dressed in his police uniform, flashed his badge at the customs officers, who waved the duo through.

Responding to the nation's large number of undocumented immigrants, the federal government implemented the 1929 Registry Act, which allowed them to register as permanent residents for $20 if they could prove they had lived in the country since 1921 and were of "good moral character." More than 115,000 registered from 1930 to 1940, at least 200,000 more after that.

"If you know what ship a person came on, and the port they entered, you could probably figure out if they entered legally," said University of Pennsylvania political science professor Michael Jones-Correa, a researcher and writer on immigration. "But what legally meant was very different at the turn of the last century, compared to what it means now."

With the Immigration and Naturalization Act of 1965, Congress abolished national-origin quotas and replaced them with less overtly discriminatory categories, including preferences for family reunification, and job-related visas. But under the rules, no country could get more than 7 percent of the total number of visas available in any given year, which in the current context works out to about 26,500 annually.

So now four countries — Mexico, India, China, and the Philippines — max out every year, said Ngai. And depending on the visa category that a person applies for, the wait can be 10, 20, even 30 years. But if you're coming from a low-immigration country such as New Zealand, she said, you might not wait at all.

When people who want to limit immigration to the U.S. say that immigrants should "go to the back of the line and wait their turn," said Domenic Vitiello, a Penn professor who teaches a course called the Immigrant City, they often fail to acknowledge there really is no single line to which everyone has equal access.

As for the notion that yesteryear's immigrants assimilated more easily than today's, that's "another common myth," said Ngai. All first-generation immigrants have trouble learning English, continue speaking their native language, and have strong ties to their ethnic communities, she said. Then as now, assimilation accelerates in the second and third generations.

"If someone says, 'My grandparents came legally, learned English, and assimilated quickly,' I can't challenge their personal story — I don't know it," said Ngai. "But I do know that was not the experience of the vast majority."