While investment gurus try to make sense of whether President Donald Trump is good for the market, companies like Geo Group  (GEO) - Get Report  and CoreCivic   (CXW) - Get Report  already have their answer.

Both Geo and CoreCivic are in the private prison business and operate as real estate investment trusts. The election of Trump to the White House and the subsequent executive orders announcing enhanced immigration enforcement point to more inmates and detainees and growth for the companies. And the market has recognized  those prospects. Since Nov. 8, Geo's share price has jumped 98% while CoreCivic has climbed 134%.

The increased share prices also reflect how hard the companies have worked to build their market share as well as their status with the government entities that buy their services. Both Geo and CoreCivic, which used to be known as Corrections Corporation of America, have spent millions of dollars on lobbying to be sure elected officials understand their business. They also invested on the political side, making contributions to both elected officials tied to security and to political action committees. In the case of Geo, that activity may come back to haunt the company as a complaint has been lodged with the Federal Elections Commission.

Michael Kodesch, who covers both companies as an analyst for Canaccord Genuity, says that the combination of immigration reform and tough-on-crime policies bodes well for the private prison sector and the rally still has a way to go.

Geo Group issued earnings guidance for 2017 at $2.05 to $2.15 per diluted share, and CoreCivic checked in at $2.22 to $2.30.

CoreCivic spokesman Jonathan Burns said in a statement to The Deal, "The company that CoreCivic has evolved into today offers a wide range of solutions - from real estate services to secure corrections and detention management to community re-entry facilities. As always, we provide these solutions to governments led by elected officials from across the political and ideological spectrum."

Geo Group declined to make anyone available for comment.

Prior to the election, prospects for the two companies were not particularly bright. The for-profit prison industry has been under a microscope. The American Civil Liberties Union has protested conditions inside private prisons. "Private prisons are inhumane profit machines where the bottom line is often more important than people's lives," says a petition on the ACLU's website that appeals to federal authorities to stop using private prisons.

The Nation and Mother Jones magazines had done a series of articles pointing out issues growing inside the prison walls, with a Mother Jones reporter going undercover at a CoreCivic facility for four months.

Then last August, the Department of Justice distributed an internal report authored by its inspector general called "Reducing our Use of Private Prisons," panning the performance of for-profit-prisons. As a result, then-Deputy Attorney General Sally Yates ordered the DOJ to phase out the use of facilities run by private companies. In part, Yates' memo stated the private facilities compared poorly with prisons operated by the feds, and the private prisons lacked educational and job-training programs. Yates also said that the federal prison headcount was on the decline, so use of the private facilities no longer made economic sense. The memo directed the DOJ to essentially allow the contracts for private facilities to lapse.

That day, the share prices for Geo and CoreCivic dropped. Geo saw its stock tumble to $15.58 from an open of $30.96. CoreCivic's stock slid off the table as well, from an open of $25.61 to $12.34.

Last September, facing a drop in its federal business, CoreCivic announced it planned to lay off 12% of its employees as a part of a restructuring.

But an improbable election win by Trump, a businessman and TV personality, changed the fortunes for both Geo and CoreCivic. The day after the election, Geo shares opened at $28.68, up $5.17 from the day before. CoreCivic opened at $19.27, a $5.09 jump from $14.08.

And the news for the two companies kept getting better. Yates was shown the door Jan. 30 for refusing to defend Trump's original travel ban tied to predominately Muslim countries.

When Alabama Sen. Jeff Sessions was confirmed as the new attorney general just nine days later, the companies received more good news. Two of Sessions' former senate aides, David Stewart and Ryan Robichaux, went to work for lobbying firm Bradley Arant Boult Cummings. The pair were hired to lobby the Bureau of Prisons on contract use of correctional facilities on behalf of Geo. That company had already purchased a 734-bed facility in Sessions' home state in 2015.

In late January, the Trump administration gave a 20-page memo to Homeland Security officials talking about how to increase enforcement efforts. The memo included a suggestion that the department could increase the number of immigrants being held from an average of 33,000 a day to as many as 80,000 immigrants.

For the most part, both companies are paid a negotiated figure of per diem for each prisoner in each facility, so the higher the daily population, the more revenue they can make.

A pair of democratic congressman took notice of political donations flowing from the two companies and the Trump administration's reversal of policy regarding the DOJ's use of private prison facilities. "That connection seems suspiciously evil," said Rep. Emanuel Cleaver, D-Mo. in a published interview in early March.

Rep. Luis Gutierrez, D- Ill. was even more outspoken. "With the massive increase in deportations and criminalizing people planned by Trump, prisons are looking at a fat windfall from the sorrow of others. We just wanted to put these companies on notice that the American people are watching and that profiting from incarceration has moral consequences."

A White House spokesman dismissed the remarks, labeling them partisan.

Both CoreCivic and Geo Group have accessed the private-investment-in-public-equity market, with the Geo Group raising $200 million in a pair of at-the-market-offerings, one in 2013 and the other in 2014. CoreCivic raised $200 million in an ATM last year.

Investors in Geo Group, according to FactSet Research Systems Inc. include the Vanguard Group Inc. with 17.6%, BlackRock Fund Advisors at 11.4% and Barrow, Hanley, Mewhiney & Strauss LLC with 6.1%.

Vanguard and BlackRock are also bullish on CoreCivic as they own 15.7% and 8.1% respectively. Hedge fund Millennium Management LLC has 4.1%.