Being buried alive is a nightmare that ranks alongside masked chainsaw-wielding madmen and enormous tarantulas. And it’s precisely the fate that befell a 91-year-old Polish woman named Janina earlier this week. Having spent 11 hours in cold storage, she began moving around within her body bag, where mortuary staff found her alive and well.

A few weeks before this, a video surfaced of an Ebola victim in Monrovia, Liberia who had been presumed dead. As the burial team arrived to remove the body, he began making small movements and was found to be still alive. Earlier this year, 78-year-old Walter Williams found himself in a similar predicament. Pronounced dead on a Wednesday night, funeral home workers preparing to embalm the man found him struggling to extricate himself from his body bag. Another incident, in January, involved a Kenyan man, Paul Mutora, who woke up in the morgue 15 hours after being pronounced dead.

At first, family members are awestruck—amazed and thankful that their loved one is still with them. But confusion and frustration soon follow. This is entirely understandable—after all, it is unsettling that a physician could make such an obvious mistake.

However, the line between life and death is, without a doubt, blurry. Death is not a yes or no question; rather it is the cessation of a number of different processes and mechanisms, ranging from the beating of the heart to the firing of neurons. It is entirely possible for some of these mechanisms to be functioning while others have ceased. This is one central reason that situations involving brain death are so complicated—the definition of death is not entirely clear. Death is interpreted differently by various people, cultures, and even science.

Often, the processes that result in death begin when the heart stops beating. This means the body’s organs begin to use up their supply of oxygen and other key nutrients while accumulating toxic waste products. This process, beginning at the level of individual cells, expands to encompass the lungs, muscles, kidneys, and eventually every organ system. The brain, also an organ, is particularly sensitive to the loss of oxygen. Neurons begin to die within four to six minutes of oxygen deprivation.

One hypothesis as to why the above patients woke up, with perhaps the exception of the Ebola patient, is that they underwent significant cooling processes when placed in the morgue. This slows the rate of all the above processes and increases the chances that someone can recover quickly enough to wake up. It is likely that these patients presented with extremely weak pulses and were unconscious when examined by the medical team, resulting in the pronouncement of death. If the temperature of the brain is brought down (i.e. hypothermia) the brain needs less oxygen and fuel, thus potentially surviving for longer periods of time during extreme stress. During brain surgery, we often cool patients down while they are sleep under anesthesia to protect the brain as we remove tumors, clip aneurysms, or fix malformations.

There are a few key findings that medical providers can use to determine death. One is pulse, classically at the wrist. In patients who are very ill, the best chance at finding a pulse might be on the carotid arteries, which are up both sides of the front of the neck. Doctors will likely check more than one location for pulses to determine if the heart is beating. Doctors will also check for evidence of respiration. Examination of the eyes and their response to light can also provide important information about the patient’s vitality.

There are conditions where the heart and many other organs are functioning relatively well, but the brain is very ill. These patients, often thought of as brain dead, present a distinct ethical dilemma. If a person looks like they are alive, but their brain shows no signs of activity, is this person dead or alive? It is not hard to see how this debate calls into question deeply personal religious and philosophical beliefs.

As technology, science, and education continue to extend the average life span of the average American, the definition of death stands to become even harder to pin down. In all likelihood, the pronouncement of death will likely include even more gray area in the future. The ordeal faced by Ms. Kolkiewicz, the Ebola victim, Mr. Williams, and Mr. Mutora is terrifying. Thankfully, this phenomenon is rare, but it serves as an important reminder that as much as science has taught us about the human body, much remains to be uncovered.