Reshma was trapped in a wide Muslim prayer room in the basement of the eight-story Rana Plaza building that housed five garment factories and thousands of workers in Bangladesh

AFP/Getty Images A Bangladeshi woman named Reshma is rescued on May 10, 2013, nearly 17 full days after the Rana Plaza building collapsed in Dhaka

Reshma was trapped in a wide Muslim prayer room located in the basement of the eight-story Rana Plaza building that housed five garment factories and thousands of workers in Bangladesh.

There are of course no rules that predict who survives a disaster such as a fire or an earthquake. And there are no guidelines that guarantee escape when the walls and the world come crashing down, as they did around Reshma when the garment factory where she worked collapsed.

Having the open space for oxygen is likely one of the reasons Reshma survived the tragedy. Over 1,100 other Bangladeshi people were not so fortunate.

Reshma has yet to recount how she lived for 17 days among the wreckage, and while such experiences are rare, remarkable stories of survival are not impossible. Following the Sept. 11 terrorist attacks on the World Trade Center in New York City, Port Authority officers Sergeant John McLoughlin and Will Jimeno were trapped 30 ft. beneath the rubble for hours. McLoughlin waited 22 hours before being dug out and Jimeno waited for 13.

In 2010, a 7.0 earthquake near the town of Léogâne in Haiti devastated the country. Evans Monsignac, a father of two, was the last person to be rescued alive from the debris in the capital of Port-au-Prince after 27 days without food and water. “I still don’t understand how I’m here,” Monsignac told the Telegraph during his recovery in the Tampa General Hospital in Florida. “I was resigned to death. But God gave me life. The fact that I’m alive today isn’t because of me, it’s because of the grace of God. It’s a miracle, I can’t explain it.” Similar survivors were discovered among the rubble in the 2008 earthquake in China’s Sichuan province, including an eight-months-pregnant woman who was rescued after 50 hours under debris.

(MORE: How Disasters Bring Out Our Kindness )

Surviving for extended periods of time amid wreckage is the result of a mixture of good fortune, health and drive. “Ultimately it is related to an individual’s pre-injury status,” says Dr. Robert Glatter, an emergency medicine physician at Lenox Hill Hospital in New York. “It comes down to their physical ability to withstand the strain. When you are trapped in such a building collapse, there is practically no available oxygen, and pre-injury medical status matters. Some people have survived a few weeks.”

Being in relatively good physical health before the emergency can be a game changer for survival — specifically, says Glatter, a strong liver and kidneys. The liver breaks down glycogen, which is the stored form of glucose that your brain and heart need to survive. “If your liver is functioning, you have a glycogen supply of one day to sustain you. The body then turns to fats and fatty acids for energy over the next several days. After three to four days, the body starts breaking down muscle to amino acids to produce energy,” he says. “That’s why it is unusual for people to survive beyond that. They survive often by breaking down muscle. You break your body down for energy.”

Typically, a human being can survive about three to seven days without food and water. Water is more vital than food, and some individuals can live much longer without food if they still have water. But not eating or drinking for much longer than that can lower the odds of survival significantly.

(MORE: How Disasters and Trauma Can Affect Children’s Empathy)

As in Reshma’s case, having sufficient oxygen to sustain the heart and other body functions is also critical. And the greater the air pocket, or space to breathe, the better. “Carbon dioxide builds up in a confined space. There’s not a lot of oxygen and humans are breathing out carbon dioxide. The high CO2 causes an imbalance of oxygen and carbon dioxide and that leads to hypoxia, so people often asphyxiate. The carbon dioxide also makes them sleepy with the high carbon dioxide and people just pass out,” says Glatter.

The types of injuries a trapped individual sustains can also contribute to the likelihood of survival. While that may seem obvious, Glatter says that compression injuries to limbs can lead to fluid buildup of toxins in the bloodstream that can determine whether the victim survives the disaster. “When you release the pressure from a limb that has been compressed, all the bad factors, specifically the toxin buildup and the potassium and phosphorus — all these bad factors that build up can get released into the bloodstream. Sometimes an amputation will be done to reduce the risk of this reperfusion injury,” explains Glatter.

Psychological strength is also an important resource on which to draw during such draining and discouraging situations. As writer Amanda Ripley writes in the TIME story “A Survival Guide to Catastrophe,” enduring a disaster is not simply a product of luck. She writes:

We can do far more than we think to improve our odds of preventing and surviving even the most horrendous of catastrophes. It’s a matter of preparation — bolting down your water heater before an earthquake or actually reading the in-flight safety card before takeoff — but also of mental conditioning. Each of us has what I call a “disaster personality,” a state of being that takes over in a crisis. It is at the core of who we are. The fact is, we can refine that personality and teach our brains to work more quickly, maybe even more wisely. Humans are programmed with basic survival skills. When frightened, we get a shot of performance-enhancing hormones, and the blood pumps to our limbs to help us outrun whatever enemy we face. But in modern times, we’re hardly aware of such natural skills, and most of us do little to understand or develop them. We could, for example, become far better at judging threats before catastrophe strikes. We have technological advantages that our ancestors lacked, and we know where disasters are likely to occur. And yet we flirt shamelessly with risk. We construct city skylines in hurricane alleys and neighborhoods on top of fault lines — as if nature will be cowed by our audacity and leave us be. And we rely on a sprawling network of faraway suppliers for necessities like warmth and food. If the power cuts off, many of us still don’t know where the stairs are in our skyscrapers, and we would have trouble surviving for a week without Wal-Mart. Yet the knowledge is out there. Risk experts understand how we could overcome our blind spots and more intelligently hedge our bets. In laboratories and on shooting ranges, there are people who study what happens to bodies and minds under extreme duress. Military researchers conduct elaborate experiments to try to predict who will melt down in a crisis and who will thrive. Police, soldiers, race-car drivers and helicopter pilots train to anticipate the strange behaviors they will encounter at the worst of times. Regular people can learn from that knowledge, since, after all, we will be the first on the scene of any disaster.

Ultimately, however, surviving a disaster is the result of an unpredictable alchemy of luck, preparation and, as the experience of 9/11 and countless earthquakes and tsunamis have taught us, the resilience of rescuers who risk their own safety to help others.