Under US and international law, people have the right to seek asylum in another country. So the 150 or so Central Americans who traveled north through Mexico in a migrant caravan are perfectly within their rights in waiting to do so at the southern US border.

For the past few days, they’ve been camping on the ground in Tijuana, Mexico, just outside the San Ysidro port of entry.

“They're making it sound like what people are doing .... arriving and surrendering themselves to start the asylum process, is illegal,” says Houston immigration attorney Mana Yegani of the way US President Donald Trump and his administration have portrayed the group.

That’s not the case, she says, and lawyers worry that the negative rhetoric around the caravan will get in the way of people’s right to the fair process to which they’re legally entitled.

Related: At the US-Mexico border, migrants face uncertain wait

“The one thing that has to be clear is that these people are not openly defying our border. They are not breaking the law,” she says. “In fact they're doing it the right way. They're doing it the way that the law permits to seek asylum like any other refugee in the world.”

So, what exactly happens when one presents themselves at the border? Yegani walked us through the process.

I am going to explain in summary how one surrenders themself at the U.S. Border to request Asylum. The “border” can be at an airport or any other U.S. port of entry. Upon arrival at the port of entry the Asylum seeker surrenders themself to a Customs & Border Protection Officer.. https://t.co/PldEsBFhh4 — Mana Yegani (@Law_Mana) April 30, 2018

“They will go into custody, which is a fancy way of saying immigration jail," Yegani says. Migrants are willing to go through that process because they fear for their lives, she says.

The asylum-seeker is then put in expedited removal, or deportation proceedings.

...At that point CBP books the person, takes their fingerprints, & performs a short question and answer with the Asylum seeker. A report is populated on the Asylum seeker. That report is called an I-213.... — Mana Yegani (@Law_Mana) April 30, 2018

During the question and answer session, the asylum-seeker must testify under oath that they have a fear of persecution if they return to their home country, Yegani says. Under international law, she says, “we have a duty not to return a person to a country where they may face torture or other serious harm.”

All of these steps are part of the US’ legal obligations toward asylum-seekers under the UN Convention Relating to the Status of Refugees, also known as the 1951 Refugee Convention.

Next, asylum-seekers’ cases are then referred to a regional asylum office.

The Asylum seeker will be booked in immigration jail/detention for several weeks until an Asylum Officer schedules them for a Credible Fear Interview. This interview is conducted by an Asylum officer and an interpreter since most Asylum seekers don’t speak English... — Mana Yegani (@Law_Mana) April 30, 2018

“Credible fear” is an asylum law concept where people must demonstrate they fear returning home until their asylum case is processed. Fear can be based on five categories: race, religion, nationality, political opinion, or membership in a particular social group. Economic factors, such as fleeing poverty, typically don’t pass muster.

....When an Asylum seeker is Interviewed by an Asylum officer they must show credible fear based on one of the five protected grounds (race, religion, nationality, membership in a particular social group or political opinion)... — Mana Yegani (@Law_Mana) April 30, 2018

Demonstrating credible fear is also not a guarantee they’ll be granted asylum; it merely allows them to move on to the next step in the process. Often an interpreter is on the phone during the interview, along with an attorney if the asylum-seeker has the means to hire one.

“In immigration proceedings, because it's a civil proceeding, the government does not get court-appointed, or free, lawyers,” Yegani says. Some legal services organizations provide pro bono attorneys, but it’s rare.

People remain in detention as they await a credible fear interview.

Sometimes the wait in the immigration jail can be over a month since we have a shortage of Asylum officers who conduct Credible Fear interviews. If the Asylum seekers crossed the border as a family, generally the husband will be separated and the mom is booked with the children. — Mana Yegani (@Law_Mana) April 30, 2018

More: 20 years ago, asylum seekers were not automatically put in immigration detention

If border officials find a person does not have credible fear, they can request a review by an immigration judge. That’s typically where attorneys get involved.

“And that’s why Attorney General Jeff Sessions says these asylum cases are backing up our immigration courts,” Yegani says. “Because when a negative finding of credible fear is found, the person, by law, has a right to request an immigration judge to review their case. And this basically infuriates the attorney general, and he calls immigration lawyers dirty immigration lawyers because we are following the law and allowing for a judicial review of the person's credible fear.”

"The system is being abused to the detriment of the rule of law, sound public policy, public safety, and of just claims," Sessions said in remarks to the Executive Office for Immigration Review on October 2017. EOIR oversees immigration courts.

If the person does demonstrate credible fear, they are sometimes — but not always — released from custody and ordered to appear later before an immigration judge to present their case.

Even that is not a guarantee of being able to stay in the US. The vast majority of Central and South Americans who appear before judges are denied asylum.

....If the Asylum seeker is found to NOT have #credible fear they will be deported to their country and barred for 5 years from the United States. This can quite devastating for someone who went through a life threatening difficult journey to get to the United States... — Mana Yegani (@Law_Mana) April 30, 2018

“If the person is granted asylum they will be given a green card one year after the date of approval of their asylum,” Yegani says.

Next: A migrant from El Salvador gets her chance in immigration court