New research reveals how despots like the rulers of ancient Egypt, including King Tut (represented here), arose to power.

The rulers of ancient Egypt lived in glorious opulence, decorating themselves with gold and perfumes and taking their treasures with them to the grave.

But how could such a hierarchical, despotic system arise from egalitarian hunter-gatherer societies? The reasons were part technological and part geographical: In a world where agriculture was on the rise and the desert was all-encompassing, the cost of getting out from under the thumb of the pharaoh would have been too high.

"There was basically nowhere else to go," said study author Simon Powers, a postdoctoral researcher in ecology and evolution at the University of Lausanne in Switzerland. "That cost of leaving could basically lock individuals into despotism." [Photo Gallery: Images of Egypt's First Pharaoh]

From egalitarianism to hierarchy

Ancient Egypt is just one example of a society that transitioned from equality to hierarchy. During the Neolithic Period, often referred to as the Stone Age — which began about 10,000 years ago — agriculture began to replace hunting and gathering as the principal means for obtaining food. At the same time, societies in which everyone had been more or less equal began to schism into classes, with clear leaders emerging. In many cases, these leaders held absolute power.

Many researchers have theorized that agriculture allowed people to hoard food and resources, and that with this power, they could induce others to follow them. But no one had ever convincingly explained how the transition from no leaders to leaders could have occurred, Powers told Live Science. If everyone in hunter-gatherer societies was more or less equal in strength or resources to start, why would they allow an individual to dominate in the first place? [Dictator Deaths: How 13 Notorious Leaders Died]

To find out, Powers created a computer model filled with individuals who had their own preferences for egalitarianism or hierarchy. In the model, as in life, the more resources an individual possessed, the more offspring they could have. In the simulations, populations would sometimes gain a voluntary leader — though the next generation down the line could choose to break off from that leader, at a cost of some resources. (Leaders' children did not defect, given that they stood to inherit their parents' wealth.)

The simulations revealed that voluntary leadership arises when leaders give enough benefits to their followers at the outset, Powers said. If leaders give their people an advantage in producing food, the people will follow them, he added.

From leaders to despots

But leadership turns to despotism when two factors arise. The first is the growth of population density and size, which follows naturally from an organized, agricultural society.

"It basically becomes hard for individuals to stop following the leader," Powers said. "As the density of the population grows, there is less free land available."

This leads to the second factor: a feedback loop. With the benefits of leadership, subjects get more resources and thus are able to have more children. These children increase the population size and density, leading to even less free land and fewer opportunities to leave.

However, if the cost of leaving the group is low — perhaps because there's a friendly city nearby to join, or open land an easy journey away — despotism can't arise. People simply leave when a leader becomes too powerful. When the cost is high — either because of geographical barriers, such as Egypt's desert, or practical ones, such as the need to access to irrigation — people have to put up with more abuse of power from their leaders.

"In hunter-gatherer groups, if an individual tries to behave in a despotic way, then the rest of the group simply gets up in the middle of the night and walks away, but with agriculture that was much less feasible," Powers said.

The findings can explain differences in hierarchy across the Stone Age world. For example, Peru was the site of multiple early states, which evolved in long, fertile agricultural valleys. To leave one of these valleys, people would have had to cross the mountains — a dangerous and difficult undertaking, Powers said.

In contrast, the Amazon basin remained more egalitarian even after the advent of agriculture, likely because it was easier to move around and find suitable land.

Some of these Stone Age rules still remain today. In democratic societies, Powers said, it's easier to kick out a leader, so leaders rarely achieve despotism. In nondemocratic societies, however, leaders can behave in more autocratic ways without fear of losing their perch.

Powers and his adviser Laurent Lehmann, also of the University of Lausanne, reported their findings Aug. 5 in the journal Proceedings of the Royal Society B. The next step, Powers said, is to scale up the model.

"I want to look at what drove the creation of large-scale states from despotic groups," he said.

Follow Stephanie Pappas on Twitter and Google+. Follow us @livescience, Facebook & Google+. Original article on Live Science.