Life in jail is no cake walk — and it's even harder when you don't know the unwritten rules.

Several law-abiding citizens learned those rules the hard way when they went undercover as inmates for the A&E show "60 Days In." Now in its fourth season, the show followed the undercover participants as they navigated jail life at Clark County Jail in Jeffersonville, Indiana, and Fulton County Jail in Atlanta, for two months.

The participants were given false identities and booked under fake charges during their stints behind bars, and needed to maintain their cover stories to prevent other inmates from catching on.

As they quickly learned, jail life is governed by strict rules that dictate the way inmates eat, sleep, socialize, and solve disputes. Most people don't know about these complex social dynamics until they experience them for themselves.

Read on to find out about the complicated dynamics that take place in jail.

1/

On their first day, new inmates often find themselves getting grilled by veteran inmates about the nature of their crimes. Inmates are on high alert for inconsistencies in someone's back story, which could suggest they are an undercover mole.

A&E

2/

The undercover inmates quickly learned that there is a strict social hierarchy in jail that governs everything from where you sleep to whether you get to shower or not.

A&E

3/

New inmates are constantly getting tested by those higher on the social ladder. In one early episode, an undercover inmate named Jeff got pressured into buying commissary items for a veteran inmate. Word quickly spread that Jeff could be taken advantage of.

A&E

4/

Another undercover inmate, Tammy, was thrust into an uncomfortable confrontation early in her stay after an inmate stole her sandals.

A&E

5/

Inmates aren't allowed to have money in jail, so food is the de facto currency. Drugs that were illegally smuggled in were often exchanged for items like ramen noodles and potato chips.

A&E

6/

One undercover inmate, Alan, became a target when inmates noticed he ordered an unusually large amount of commissary items. 'Outside, it's a honey bun, but in here, it's like carrying around a brick of gold,' he said.

A&E

7/

Gang life played a large role in Fulton County Jail's social dynamics. The 'pod boss' — the inmate with the most power in each section of the jail — was often a gang member who had the most sway on the outside.

A&E

8/

Whenever there was a dispute between inmates, it almost always was resolved with violence. Even seemingly trivial issues, like when one inmate reneged on his promise to give another inmate his hash browns, erupted into bloody attacks.

Screenshot

9/

When a fight breaks out, bystanders know to keep their distance and let it play out. And they certainly don't tell any guards. 'You can get murdered in here for something like that,' Alan said.

A&E

10/

Fights are one way for new inmates to climb the social ladder in jail — even when they lose. 'If you take that beating, you're more respected,' said Ryan, an undercover inmate.

A&E

11/

Inmates can earn respect in other ways too. One undercover inmate, Emmanuel, found getting into a shouting match with a corrections officer was a successful strategy.

A&E

12/

Inmates are fiercely territorial with their scarce resources. One undercover inmate, Zac, knew he was accepted when he scored an invite to a group dinner featuring a grab-bag of commissary items.

Screenshot/A&E

13/

Inmates even manage to throw parties in jail featuring homemade alcohol and 'whippit' — a taffy-like substance made with sugar, coffee, and prescription narcotics.

A&E

14/

Once they get released, inmates often struggle to readapt to society outside of jail — even if they were only there for 60 days.