Mecca is the holiest city in Islam, the storied site of key locations from the Quran and, once a year, center of the hajj, a sacred pilgrimage that brings upwards of 3 million people to Saudi Arabia from all over the world. This week Mecca was also the site of a tragedy—nearly 800 people killed in a stampede in Mina, the semi-permanent tent city that houses tens of thousands of pilgrims. It wasn’t the first time something like this has happened during the hajj, and just as before, the causes remain the same: physics and evolutionary psychology.

This isn’t a new problem. One of the first documented human stampedes happened in 1896, at the coronation of Tsar Nicholas II outside Moscow; 1,000 people died after rumors spread that the concession stands were running out of souvenirs. They’ve happened at mass religious gatherings in India, football games in Europe, rock concerts in the US. One epidemiological study found 215 stampede events between 1980 and 2007.

The hajj, site of Thursday’s tragedy, has for decades been particularly deadly. As the numbers of pilgrims have risen, so too have the mass casualty events. In the 100 years before 2009, five of the 10 deadliest human stampede events happened in the Mina Valley.

After one in 2006, Saudi authorities instituted single-direction pathways, visitor counts, and theme park-like scheduling of visits. The Jamarat Bridge, location of three pillars that represent the devil, at which pilgrims are supposed to throw stones, was the site of a stampede that killed over 1,000 people; today it’s a multi-level, multi-exit complex designed to keep people moving. In the past decade or so, the Saudi government has worked with a wide variety of architects and designers, including the famed international firm Gensler, to improve flow and safety at all of the hajj’s major sites, from the central mosque to the tent city.

Put that many people in so confined a space, though, and preventing stampedes will always be a challenge. Part of the problem is fluid dynamics—except people are the fluid.

Panic Mode

The problem starts with either a “craze,” in which people are all trying to get to a destination, or “escape panic,” in which they’re all trying to get away. In both cases, movement is unidirectional, as in, everyone is trying to move in the same direction. Unidirectional flows typically aren’t much of a problem until they encounter an obstacle—a narrow door, let’s say, or a tight turn.

The other option, “turbulent,” is when people are trying to get to a bunch of different places at once, or when crowds moving in two different directions collide. Reports from Mina suggest that’s what happened here—crowds were moving along two different streets in the tent city and ran into each other at a bottlenecked intersection.

Both modes can be deadly under stampede conditions. Six to seven people pushing continuously in a single direction have, in some cases, exerted enough force to bend steel railings. Researchers have hypothesized that during turbulent stampedes the forces are actually lower, because the multiple vectors—which is to say, people pushing in all different directions—cancel each other out.

On the other hand, if all those vectors are pushing inward ... well, cause of death in stampedes tends to be either crush trauma from being trampled or asphyxiation. Autopsies of people who suffocated in stampedes show pressures as high as 6.4 psi exerted on the chest—that’s nearly half an atmosphere. Some people have died where they stood, trapped against other people until the pressure released. It’s a bad, bad way to go.

Reports from Mina suggest crowds were moving along two different streets in the tent city and ran into each other at a bottlenecked intersection.

“Densities get so high that there’s just one body next to each other, and any little movement creates a force exerted on adjacent bodies,” says Dirk Helbing, a computational social scientist who studies crowd dynamics at ETH Zurich. (Helbing was involved in early work on the Jamarat Bridge, but hasn’t been directly involved with Mecca for years.) “You’re exposed to this random pushing. As a result you might lose your balance and fall to the ground, and what happens is a hole opens up in the crowd. Those standing around it lack counterforce, and they fall on top of the person.”

That event then propagates outward, though not evenly in every direction. According to Helbing’s model, pedestrians are essentially just trying to avoid obstacles—including other pedestrians—while making their way to a given destination as quickly as possible. At low densities, which is to say no crowds, you get laminar flow, as smooth as a flat-bottomed, fast moving river.

As density goes up, the number of times an individual pedestrian has to slow down or stop outright goes up, too—which forces all the pedestrians trying to get around that person to do the same. Stop-and-go waves start to propagate outward from each choke point.

Pretty soon all the slick avoidance moves everyone has been making switch to unintentional ones. The classic coordinated moves that crowd dynamics researchers recognize from sidewalks, like spontaneous organization into directional lanes and platooning according to walking speed, break down. Order flips to chaos. That’s turbulence.

The critical density for when a crowd goes critical varies according to average body size and weight of the people involved, Helbing says, but it’s usually somewhere between five and 10 people per square meter.

Social Animals

But why are people so vulnerable to catastrophe when crowds get thick enough? Other creatures, from anchovies to slime molds to starlings, manage to pull off dazzling feats of coordination when they’re crowded together. In fact many of those collectives share similar mathematical characteristics, says Iain Couzin, a biologist at Princeton who studies collective behavior.

“When we see a coordinated bird flock or fish school, these things have evolved to do this,” Couzin says. “Unfortunately, we have not. We’ve evolved to be in small family groups.”

More and more, human beings live in crowded cities. But the human brain may not have quite caught up to what it built. “We don’t know how to behave in these scenarios,” Couzin says. “These situations do not allow us to naturally feel that we can understand what’s going on.”

That’s not to say that under certain circumstances human beings won’t engage in classic collective behavior. People do—they follow leaders, for example, or make any of those classic pedestrian moves that Helbing studies. But the kinds of sets of small, simple rules that lead to spontaneously self-organized flocking just don’t kick in. “Not all the time, but most often it’s about the spread of panic, not an actually dangerous environment,” Couzin says. “The response creates the danger. The strong collective response is a very dangerous thing in certain circumstances.”

That’s the lesson the organizers of the hajj have been trying to unpack. This week they learned they hadn’t—and that they have to keep trying.