NARRATION: As the Trump Administration continues to crack down on undocumented immigrants, the majority of them will be sent to detention facilities run by private companies.

ARCHIVAL (MSNBC, 6-22-18):NEWS REPORT: Private prisons. They are cashing in on President Trumps get tough policies at the border.

NARRATION: How did immigration detention become more than a billion dollar industry? And does it matter that detention is now heavily privatized?

Josue Vladimir Cortez Diaz grew up gay in El Salvador, where he says he was persecuted for years, targeted by gangs, and extorted. After receiving death threats, he fled to the United States hoping for asylum, was caught crossing the border, and sent to a detention facility in Adelanto, California.

JOSUE VLADIMIR CORTEZ DIAZ: The conditions in the detention center, theyre bad, right down to the food. The clothing that they give us is clothing that had been used by other inmates. They dont care if someone is sick, if the food goes bad. Thats how we came to say, we have to protest.

NARRATION: But when Cortez Diaz and others launched a hunger strike, they say the guards roughed them up, pepper sprayed them, and threw some of them into hot showers.

JOSUE VLADIMIR CORTEZ DIAZ: They were showers with hot water, which made the gas more reactive. So there we were, all screaming. We were screaming and crying, saying why? And we couldnt even move because we were handcuffed in that moment. We couldnt do anything.

NARRATION: The company that runs Adelanto, GEO Group, says these claims are completely baseless. But Cortez Diazs lawyer, Rachel Steinback, says she believes the problems at Adelanto were exacerbated because of the fact that the facility is privately run.

RACHEL STEINBACK (ATTORNEY FOR CORTEZ DIAZ): The main goal of a private prison company is to maximize profit, and to maximize profit you minimize your expenditures. All of the incentive is to get more people in, hold them there for longer, and provide them with the barest necessities possible.

NARRATION: But GEO Group says they are proud of their long-standing record of providing high quality detention services that meet standards set by the government.

The use of private companies took hold in the 1980s, as the country faced a crisis overcrowded and unsafe public prisons.

ARCHIVAL (CBS, 12-20-83):NEWS REPORT: American business is becoming bullish on prisons.

NARRATION: And a new company – the Corrections Corporation of America, or CCA now called Corecivic offered an alternative.

ARCHIVAL (CCA VIDEO, 1987):At CCA, we have an answer to your problems.TOM BEASLEY: We intend to be the IBM if you will of the corrections business..

NARRATION: But the idea of prisons for profit was met with skepticism.

ARCHIVAL (CBS, 12-20-83):DAN RATHER: A highly controversial idea: turning the jail keys over to private business and trying to make crime pay to investors.

NARRATION: James Stewart, a Justice Department official, was studying the issue.

JAMES K. STEWART (DIRECTOR, NATIONAL INSTITUTE OF JUSTICE, 1982-1990): They had no history. And youre saying, Whats your experience? They go, Well, well get a warden. Well hire a couple of people to train them. We can do it. And youre like, Im not sure this is going to work, right?

ARCHIVAL (ABC, 9-16-85):JOHN QUIONES: What about the prisoners. Who is accountable for their welfare? Critics of private prisons say making a profit off imprisonment is not compatible with the administration of justice.

NARRATION: But the test of the controversial idea came not with prisoners, but with immigrants.

ARCHIVAL (NBC, 5-6-80):ANCHOR: President Carter today declared parts of Florida to be under a state of emergency because of the enormous influx of Cuban refugees.

ARCHIVAL (NBC, 2-23-84):TOM BROKAW: Illegal aliens, more than a million of them in the past year, have come across the Mexican border.

NARRATION: Immigration authorities were overwhelmed.

ARCHIVAL (NBC, 2-23-84):GEORGE LEWIS: Part of the problem says the Immigration Service is that there are not enough places to hold all the illegal immigrants.

JAMES K. STEWART: They were scratching their heads saying, What are we going to do?

NARRATION: The Immigration and Naturalization Service, or INS, the predecessor to ICE, turned to the private sector.

RICHARD CRANE (VICE PRESIDENT OF LEGAL AFFAIRS, CCA 1984-1987): INS was the first government agency to really come out strongly for privatization. I mean, they were under the gun to do it.

NARRATION: Richard Crane believed privatization would not lower standards, and could lead to better conditions.

RICHARD CRANE: A lot of people had the misimpression that in order for them to make a profit, they had to cut corners. When I was with CCA, they didnt cut corners.

ARCHIVAL (CBS, 12-20-83):FRED GRAHAM: This construction site in Houston Texas will soon become the first completely free enterprise prison in the United States. It is being built to detain up to 300 aliens charged with entering this country illegally and awaiting deportation hearings.

JAMES K. STEWART: It was like a proof of concept. What it did is it provided evidence that this could work and you could get more for the same amount of money, and right now we needed more.

ARCHIVAL (C-SPAN, 12-22-87):TOM BEASLEY: We built the facility in 6 months

NARRATION: Building on that success, the industry began to expand.

ARCHIVAL (ABC, 9-16-85):JOHN QUIONES: The private prisons are clean, spacious and well-managed.

ARCHIVAL (ABC, 9-16-85):INMATE: In here, its enchanted, I mean, very enchanted.

NARRATION: Soon, private companies were running local, state and later federal jails and prisons.

JAMES K. STEWART: They will find ways to economize. And so we said, Look, if youre going, going to have the private sector, youre going to have to be sure you have inspections. Thats part of the price. You have to build that into the contract.

ARCHIVAL (ABC, 9-15-85):JOHN QUIONES: The denial of freedom is now clearly big business.

NARRATION: But over the years, problems began to make headlines.

ARCHIVAL (CBS, 11-24-94):JIM STEWART: In Arizona, inmates rioted twice at this private prison in less than a month.

ARCHIVAL (CBS, 7-23-98):DAN RATHER: New questions are being raised tonight about the wisdom of turning public prisons over to private operators.

ARCHIVAL (CBS, 7-23-98):JIM STEWART: Charges have been filed against them now in three other states and the Justice Department says it is watching closely.

NARRATION: Civil rights groups like the ACLU argued that private companies shouldnt be performing a government function.

CARL TAKEI (SENIOR STAFF ATTORNEY, ACLU): Handing control of prisoners over to a for-profit company is a recipe for abuse and neglect. There are serious human costs that have been documented over and over again.

NARRATION: But companies like Corecivic say that they maintain high standards of care for detainees and that in fact, their sole job is to help the government solve problems including the fluctuating need for detention space.

The government has expanded its detention of undocumented immigrants over the years increasingly so, starting under the Clinton Administration. And private companies, have stepped up.

ARCHIVAL (PBS, 2008):NEWS REPORT: Immigration detention has turned into a gold rush for the private corrections industry.

NARRATION: Alonzo Pea had spent his career in customs and immigration enforcement. But when he became deputy director of ICE in 2008, he says he saw widespread problems with detention. Issues were apparent in government-run facilities, but Pea says many of the complaints coming in were about privately-run ones.

ALONZO PEA (DEPUTY DIRECTOR, ICE, 2008-2010): These private companies, it wasnt their priority to ensure that the highest standards were being met. When I found out that guards mistreated people, you know, violated women, abused women, didnt provide medical care. Those things troubled me. And I kept thinking, why are we not able to prevent these, these things?

NARRATION: Pea says ICE shares the blame.

ALONZO PEA: We set up this partnership with the private industry in a way that was supposed to make things much more effective, much more economical, but unfortunately it was in the execution and the monitoring, and the auditing. We fell behind, fell short.

ARCHIVAL (AL JAZEERA, 10-16-15):NEW REPORT: Immigration detention has been the private prison industrys fastest growing sector for years.

NARRATION: ICE says they thoroughly investigate complaints of misconduct, and hold contractors to high standards. Today, about 70% of detained immigrants are overseen by private companies, according to an analysis of ICE data.

ARCHIVAL (ABC, 6-21-18):PRESIDENT DONALD TRUMP: We have zero tolerance for people that enter our country illegally.

NARRATION: With these companies already so enmeshed in immigration enforcement, Pea says theyre here to stay. The question is where we go from here.

ALONZO PEA: Its important that the government maintain good oversight of these companies. Because theyre not citizens, theyre not going to be afforded the same protections. Were dealing with human beings. Thats the thing not to be lost.

JAMES K. STEWART: There are some real advantages to having the private sector. But, like anything else, it has to be reasonably well controlled and paid attention to. Vigilance is the price of freedom.

NARRATION: Rachel Steinback says lawsuits like the one she has filed on behalf of Cortez Diaz and some of the other hunger strikers can help hold private companies accountable.

RACHEL STEINBACK: Theres very little transparency. So I think they, they feel like they can operate with impunity, do whatever they want and get away with it.

NARRATION: Cortez Diaz is no longer in detention. Last year, a judge granted him asylum, and the opportunity to start a new life in the United States.

JOSUE VLADIMIR CORTEZ DIAZ: When they opened the doors and we felt the air and the breeze and saw the parking lot and everything and once were already outside, the lawyer was yelling at me Vladi! Vladi! That is a moment that Ill never forget it. But it also makes me feel uneasy for the people who are there because I know what its like to live inside.