by Sarah Childress

In Egypt in Crisis , which airs tonight on PBS ( check local listings ), FRONTLINE and GlobalPost’s Charles M. Sennott go inside the Egyptian revolution, tracing how what began as a youth movement to topple a dictator evolved into an opportunity for the Muslim Brotherhood to seemingly find the political foothold it had sought for decades — and then why it all fell apart.

The overthrow of President Hosni Mubarak in January 2011 shocked observers who believed that he had too much control over the country’s major institutions to be removed from power. The strongman may not have had nearly as much control as even he thought.

“We never realized what Mubarak was standing in front of, and that was the military,” Gehad El-Haddad, a spokesman for the Muslim Brotherhood, told FRONTLINE. “The military was the real face of Egypt and its deep state.”

The shadow bureaucracy that makes up Egypt’s “deep state” was built up by Mubarak, but it ultimately betrayed him. Since his ouster, the military has quietly maneuvered not only to remain in power but to tighten its grip on every facet of the Egyptian bureaucracy, from the state-run media to the presidency.

What Is the Deep State?

The idea of the “deep state” was first used to describe the political structure of Turkey, which has a democratic government, but also a powerful military that steps in to intervene when the leadership veers too far, in its view, towards Islamism, said Nathan Brown, a professor of political science and international affairs at George Washington University.

“Now we see the same concept being used in Egypt today, the sense that the military is not necessarily ruling directly but that there is this sort of set of institutions,” he told FRONTLINE. “What you have is kind of underneath the surface of politics, this underlying set of structures that’s running things.”

Egypt’s deep state is dominated by the military, but is supported by four other branches: the intelligence services, which work closely with the military to maintain political control; the police, which act as the public face of the deep state; the judiciary, which is packed with Mubarak-era judges; and the state media, which maintains staunch support of the military, airing patriotic music and video.

Its main mission has been to maintain order and stability — the status quo — in the influential Middle Eastern state.

How is it Funded?

For decades, Egypt’s military has functioned as a state within a state, with its own business enterprises that generate revenue to be plowed back into the armed forces. Military officers led an effort to nationalize the economy beginning in the mid-1950s, and since then, the military has built up a huge economy all its own. It’s one of the top landowners in the country and owns a web of businesses.

Young Egyptian men are required to serve in the military, providing a guaranteed source of free labor to staff the restaurants, hotels and bakeries owned by the military, as well as its factories, where it manufactures bottled-water, pasta and other products. The military also owns olive oil, cement, construction and gasoline companies.

It’s hard to determine exactly how much of the Egyptian economy is controlled by the military, because it has no civilian oversight, but estimates range from 25 percent to as high as 40 percent of Egypt’s $189 billion economy.

The military grew frustrated with Mubarak in the later years of his rule as the president began to open the economy to private businesses that ratcheted up competition and began to erode the military’s bottom line.

Mubarak was grooming his son, Gamal, to succeeded him. But Gamal is a businessman, and it wasn’t clear whether the military would support a leader who didn’t rise through its ranks. So as new businesses expanded, enriching civilians, observers believed Mubarak might be trying to bolster the private sector to act as a counterweight to the military’s might.

“Forty years ago if you had a young daughter and you wanted her to get ahead in society, you would have her marry a military officer,” said Graeme Bannermen, Middle East Institute scholar and former staffer for the U.S. Senate Foreign Relations Committee. “Under the last years of Mubarak, if you had a young daughter and you wanted her to get ahead, you would marry her to one of those nouveau-riche businessmen. That’s where the money was.”

The U.S. provides about $1.3 billion every year in military aid to Egypt, but recently, the military had been angling for a raise. In a 2010 U.S. embassy cable released by WikiLeaks, an Egyptian military officer told a U.S. defense official, Colin Kahl, that Egypt “was worth more” than that. Kahl said that might be a difficult sell in Congress, since Egypt already received the second-largest amount of assistance from the U.S., But he promised at least to keep pressing for the funding to remain intact.

How Does It Work?

Egypt’s deep state has long operated in the background. But when it seemed likely that Mohammed Morsi, a member of the Muslim Brotherhood, would be elected president, there are indications that the deep state began to work together to keep him from power.

The military has remained committed to a secular state, as under Mubarak. While all Egyptian men are required to serve as conscripts, those with extreme political or religious views generally don’t climb the military ranks. Under Mubarak, the Muslim Brotherhood was marginalized, with members sometimes rounded up, jailed and tortured.

But by June 2012, with Mubarak gone, they were on the verge of governing the country. Islamist groups, including the Brotherhood, had swept parliamentary elections the previous November. The presidency had come down to two candidates: Ahmed Shafik, a Mubarak-era stalwart, and Morsi, the Muslim Brotherhood candidate.

Just before the presidential runoff, the Supreme Constitutional Court declared the parliamentary elections invalid. The military, carrying out the court ruling, shut the parliament down. It then issued a decree awarding itself sweeping powers, effectively diluting the office of the presidency.

The next day, Morsi won the election — and was later sworn into an office that had largely been stripped of its power.

The Muslim Brotherhood was “supposedly at the helm of the state, but in fact they are missing the very important backing of four important aspects of the political regime: the police, the army, the judiciary and the press,” Khaled Fahmy, a historian at the American University in Cairo, told FRONTLINE. “So they are in power, but they’re actually not in power.”

When Morsi tried to reopen the parliament, a major state-run newspaper wrote a story about how the move sent the stock market plummeting.

Meanwhile, the traffic police melted from the streets. Police officers refused to respond to emergency calls. “The police would answer the phone and say, ‘I’m sorry, I’m on vacation for four years,’” Gehad El-Haddad, a spokesman for the Muslim Brotherhood, told FRONTLINE.

Meanwhile, Morsi struggled to govern, accused of incompetence and power grabs by his critics as he fired top military leadership and awarded himself more authority.

There was plenty to criticize. Even though members of the Muslim Brotherhood had been tortured under Mubarak, Morsi failed to publicly criticize the military or police for human-rights abuses or hold any of them accountable. The Brotherhood even had its own detention center near the presidential palace, whether they interrogated at least 49 people, beating them bloody on film, according to Heba Morayef, Human Rights Watch’s Egypt director.

Egypt’s economy also suffered under Morsi’s rule. The state-owned gas and power companies faltered, leading to electricity blackouts and fuel shortages that caused widespread anger among Egyptians. Morsi’s supporters say this was a clear example of interference by the deep state. Mubarak-era fuel brokers diverted the state-subsidized fuel for a profit, and officials refused to implement a new plan Morsi proposed to crack down on corruption in the gas industry, they said.

The state media, meanwhile, which favored positive portrayals of the military over coverage of Morsi, said the fuel shortages occurred because people were buying extra out of fear for the current political climate.

After Morsi was ousted, the fuel shortages and the electricity blackouts ended almost overnight, The New York Times said. The police also returned to the streets, providing security and directing traffic in Cairo’s clogged streets.

The military appointed the Supreme Constitutional Court’s chief justice, Adly Mansour, as interim president.

And the state media overwhelmingly backed the takeover, with the state television channel playing a music video highlighting the armed forces in an “almost erotic montage of rockets, tanks and lithe young men,” the BBC reported.

It also appears that the intelligence services, which played a more muted role under Morsi, are back online. The State Security Investigations Service, which is responsible for internal surveillance and helping the state maintain political control, had been widely accused of torture. It was dissolved in March 2011, but weeks after the military ousted Morsi, the Interior Ministry announced that it would restore its operations.

And now with Morsi under house arrest, the military is back in control, again guiding the country towards yet another new constitution and more democratic elections.

What Is the Deep State’s Endgame?

No one knows for sure. The military has long asserted that its goal was to maintain order in Egypt — which of course includes preserving its own economic clout. But does it now want to rule as well?

“One of the reasons that a lot of the revolutionaries, a lot of the anti-Morsi people, the reasons they say that they’re not nervous about military involvement now is because they really, really believe that the military doesn’t want to run the country,” said Ashraf Khalil, an independent journalist based in Cairo.

“They think the military wants to preserve its perks, its privileges, its significant private-sector economic empire, and they want to escape from civilian oversight.”

Are they right? Although a civilian is officially president, the military retains its powerful influence, and Sisi, with strong support from the state media, remains popular. Posters emblazoned with Sisi’s image cover Cairo, lauding him as the “eagle of the Arabs” and “the one we can trust.”

Sisi also has appointed new governors for Egypt’s 25 provinces — 19 are generals, and two are from the police, one of whom had openly refused to support Morsi when he was first elected, according to The New York Times.

New elections are slated for sometime next year, though a date hasn’t been set. Sisi has said he doesn’t want to run for president, but there’s already a small campaign encouraging him to do so — for the sake of Egypt.