For 150 years, the U.S. has alternated between generously admitting desperate migrants and denying them entry. Here's everything you need to know:

Has the U.S. always offered asylum?
In the country's early history, people fleeing violence and persecution were treated the same as other immigrants. The millions of Europeans who flooded into the U.S. during the 19th century included political refugees and oppressed religious minorities as well as those seeking better economic opportunities. There were no federal immigration restrictions until the Page Act of 1875 and the Chinese Exclusion Act of 1882, when Congress banned imported Chinese workers as well as convicted criminals. In the 1920s, lawmakers overwhelmingly passed strict quotas aimed at Catholic and Jewish immigrants from Eastern and Southern European countries. They "arrive sick and starving and therefore less capable of contributing to the American economy, and unable to adapt to American culture," said Sen. David Reed (R-Pa.), who co-sponsored the quota legislation. U.S. immigration law, he said, should protect "those of us who are interested in keeping American stock up to the highest standard. That is, the people who were born here."

Did that stop asylum seekers?
The quota system stopped hundreds of thousands of Jews and other Europeans trying to flee Nazi persecution from coming to America. Public opinion remained firmly against admitting more immigrants even in the face of Nazi atrocities. In a Gallup poll taken two weeks after Kristallnacht, a 1938 wave of anti-Jewish pogroms in Germany and Austria, 72 percent of Americans said the U.S. should not allow "a larger number of Jewish exiles from Germany to come to the U.S." In 1939, the U.S. granted visas to just 27,370 people from Germany and Austria, with more than 300,000 people left on a waiting list. That same year, a German ocean liner, the St. Louis, which was carrying 937 mostly Jewish refugees, asked for permission to land in Florida. The Roosevelt administration refused. About a quarter of the ship's passengers would later die in the Holocaust.

Why did the laws change?
World War II displaced at least 7 million people in Europe. In response, U.S. lawmakers created the nation's first formal refugee and asylum policies. The Displaced Persons Act of 1948 resettled some 400,000 European refugees over four years. Meanwhile, the newly formed United Nations recognized the right of refugees to seek asylum in other countries. In 1951, the U.N. defined a refugee as anyone who cannot return to his or her home country "owing to well-founded fear of being persecuted for reasons of race, religion, nationality, membership of a particular social group or political opinion." The U.S. signed on to the U.N.'s refugee protocol in 1967, finally creating a comprehensive system for granting asylum with the Refugee Act of 1980.

Who received asylum?
Mostly people fleeing communist countries. Since 1975, the U.S. has accepted roughly 3.3 million refugees, the vast majority from Cuba, Vietnam, and the former Soviet Union. Asylum seekers from U.S.-backed right-wing regimes, however, were often rejected as "economic migrants." During the 1980s, the U.S. Coast Guard detained 23,000 Haitians fleeing Jean-Claude Duvalier's repressive regime. Of those, only eight were granted asylum. The same decade, nearly 1 million Central Americans crossed the border fleeing civil wars in the region. Only 3 percent of asylum applications were approved for Guatemalans and Salvadorans in 1984, compared with 40 percent for Afghans fleeing the Soviet invasion and 100 percent for Cuban asylum seekers. This glaring disparity sparked the Sanctuary Movement, which led to Congress creating the Temporary Protected Status program in 1990 for people affected by armed conflicts or national disasters. Subsequent legislation allowed many Haitian and Central American migrants to apply for permanent residence.

How does asylum work now?
Under U.S. and international law, anyone who physically steps on U.S. soil is entitled to apply for asylum. Asylum seekers must then pass a "credible fear" interview. If immigration agents determine there is a "significant possibility" applicants can prove that they face persecution or harm in their home country, their case is referred to immigration court for a final decision. In fiscal year 2018, about 89 percent of asylum seekers passed the initial screening. But under much stricter rules imposed by the Trump administration, immigration judges went on to grant asylum in only 17 percent of the cases.

What's happening at the border?
Central Americans fleeing gang violence, lawlessness, and poverty are claiming asylum, either at official ports of entry or by crossing the border and surrendering to Border Patrol agents. The influx of people has contributed to a backlog of more than 900,000 immigration court cases and overwhelmed detention facilities. Courts have blocked many of the White House's attempts to deter people from seeking asylum in the first place, including separating families and forcing asylum seekers to wait in Mexico for their court date. "These people are not openly defying our border," says Mana Yegani, a Houston immigration attorney. "The law permits [them] to seek asylum like any other refugee in the world."

Defining asylum
The Trump administration maintains that most of the Central American migrants seeking asylum in the U.S. should not count as refugees. Then–Attorney General Jeff Sessions ruled last year that people fleeing "private violence" — including from gangs and domestic abuse — don't qualify for protection. "Asylum was never meant to alleviate all problems — even all serious problems — that people face every day all over the world," Sessions said. The White House also wants to make it more difficult for asylum seekers to prove they have a "credible fear" of going home and argues that asylum was intended for victims of government persecution, not crime. Immigrant advocates, however, say that gangs in the Northern Triangle countries of El Salvador, Guatemala, and Honduras are highly organized, often wielding more power than the government. Defying local gang leaders by resisting recruitment or refusing to pay protection money can be a death sentence, said Mauricio Ramírez Landaverde, El Salvador's minister of justice and security. "You don't know where the state ends and the criminal organizations begin," he said.

This article was first published in the latest issue of The Week magazine. If you want to read more like it, you can try 8 issues for only $1 here.