When facing potential criminal conviction, a person is entitled to legal counsel under the Sixth Amendment — unless, that is, that person is an immigrant.

In California, more than 10 million residents were born in a different country. That's 27 percent of the state's population, a figure higher than any other state. Forty-seven percent of those immigrants have residency status, which means that the other 5.3 million immigrants living in the Golden State are subject to possible detainment and deportation. If those individuals were provided with lawyers, however, their plea to stay in the United States would be five times more successful, according to a recent study from the California Coalition for Universal Representation.

Lacking legal counsel can be incredibly detrimental for an immigrant seeking residency or asylum status, says Avantika Shastri, the legal director of the San Francisco Immigrant Legal Defense Collaborative, one of the few outlets in the country providing free legal services to immigrants in the country.

"Immigration law is very technical and very complicated both procedurally as well as legally," Shastri says. "The problem is not just educating immigrants, but also providing attorneys who can help them through these complex law and procedures. The primary challenge is convincing the court to allow the case to continue until the families have found an affordable or pro-bono attorney who can help them present their case."

The few efforts to provide pro-bono counsel to immigrants have been slow but successful. In 2013, Federal District Judge Dolly M. Gee ordered Arizona, California, and Washington to appoint representatives (who may or not be lawyers) to those deemed "mentally incompetent" to represent themselves. Later that year, the Vera Institute for Justice launched the New York Immigrant Family Unity Project, the first program to provide free legal services to immigrants. NYIFUP is sustained with a $4.9 million grant from the New York City Council and serves low-income immigrants living in both New York City and New Jersey.

The San Francisco Immigrant Legal Defense Collaborative soon followed suit. The organization is comprised of 13 legal counsel groups that serve unaccompanied children and families from Mexico and Central America who are now living in the Bay Area.

Saul Estrada, a client of Pangea Legal Services (one of the San Francisco Immigrant Legal Defense Collaborative's corresponding legal groups) believes that his attorney, Luis Angel Reyes Savalza, saved him from deportation. Originally from Michoacán, Mexico, Estrada had been living in California for 27 years before he was sent to a detention center for a traffic violation.

"A lot of people didn't want to deal with my case, because they said it was too difficult," Estrada says. "My lawyer had a lot of patience with my case." After five months, Estrada was set free and returned to his family in the Bay Area.

Estrada was one of the lucky ones. On any given day in California, there are about 5,202 immigrants living in detention centers, according to data provided by Virginia Kice, Immigration and Customs Enforcement's western regional communications director. Sixty-eight percent of these detainees do not have legal representation, nor do the 27 percent of immigrants facing removal orders. In 2015, there were a total of 7,400 immigrants whose cases were heard in courts, according to CCUR. With an estimated cost of $5,000 per case, CCUR believes that an investment of $37 million would cover the legal fees of all immigrants facing court cases.

In Southern California, most immigrants in detention centers have been living in the U.S. for at least 20 years, and the vast majority were employed for at least six months before they were detained. Seventy percent of these detainees are undocumented, but the other 30 percent either hold valid visas or have permanent residence status. About half are fluent in English and 42 percent have completed high school or some college. Eighty-six percent of this group had at least one minor misdemeanor and 25 percent had one or more felony convictions, typically drug or traffic violations.

Keeping the immigrant detainment system intact is extremely costly. The price in maintaining detention centers nationwide rings up to $5.05 million per day. In California, detention centers cost taxpayers over $6.5 million a year, at a daily cost of $114 per inmate. Foster care services for children of detained immigrants costs at least $9.5 million a year, according to the Applied Research Center.

Detaining and deporting immigrants also puts a strain on California's economy. When workers are detained or deported, employers bear the burden of turnover costs, typically amounting to 15 to 20 percent of the employee's annual salary. Immigrants comprise one-third of California's workforce and contribute over $650 billion a year, which is about 31 percent to the state's gross domestic product (GDP). Undocumented immigrants generate $130 billion of that  —  a figure greater than the GDP of California's neighbor, Nevada.

"Without legal assistance, many people are deported, even if they have lived in the U.S. for many years, have strong family ties, and are legally eligible to remain," Shastri says. "These deportations tear families and communities apart. Once people understand these facts, then they understand why funding is so important to keeping families together and protecting refugees."

Pacific Standard is the award-winning magazine for readers interested in working toward forward-looking changes to private behavior and public policy. For more stories that matter, sign up for its email newsletter or subscribe now.