About three years ago Eva Salem got into some trouble with a crocodile. It snapped her hand in its jaws. In a panic, she managed to knock out the crocodile and free herself. Then, she woke up.

"I imagine that's what it's like when you're on heroin. That's what my dreams were like—vivid, crazy and active," she says. Salem, a new mother, had been breast-feeding her daughter for five months before the croc-attack dream, living on four hours of sleep a night. If she did sleep a full night, her dreams boomeranged, becoming so vivid that she felt like she wasn't sleeping at all.

Dreams are amazingly persistent. Miss a few from lack of sleep and the brain keeps score, forcing payback soon after eyelids close. "Nature's soft nurse," as Shakespeare called sleep, isn't so soft after all.

"When someone is sleep deprived we see greater sleep intensity, meaning greater brain activity during sleep; dreaming is definitely increased and likely more vivid," says neurologist Mark Mahowald of the University of Minnesota and director of the Minnesota Regional Sleep Disorders Center in Minneapolis.

The phenomenon is called REM rebound. REM refers to "rapid eye movement," the darting of the eyes under closed lids. In this state we dream the most and our brain activity eerily resembles that of waking life. Yet, at the same time, our muscles go slack and we lie paralyzed—a toe might wiggle, but essentially we can't move, as if our brain is protecting our bodies from acting out the stories we dream.

Sleep is divided into REM and four stages of non-REM; each has a distinct brain wave frequency. Stage one of non-REM is the nodding off period where one is between sleeping and waking; it's sometimes punctuated with a sensation of falling into a hole. In stage two the brain slows with only a few bursts of activity. Then the brain practically shuts off in stages three and four and shifts into slow-wave sleep, where heart and breathing rates drop dramatically.

Only after 70 minutes of non-REM sleep do we experience our first period of REM, and it lasts only five minutes. A total non-REM–REM cycle is 90 minutes; this pattern repeats about five times over the course of a night. As the night progresses, however, non-REM stages shorten and the REM periods grow, giving us a 40-minute dreamscape just before waking.

The only way scientists can study REM deprivation is by torturous sleep deprivation. "We follow the [electroencephalogram] tracing and then when we see [subjects] moving into REM, we wake them up," says psychologist Tore Nielsen, director of the Dream and Nightmare Lab at the Sacré-Coeur Hospital in Montreal. "As soon as you start to rob them of REM, the pressure for them to go back into REM starts to build." Sometimes Nielsen will have to wake them 40 times in one night because they go directly into REM as soon as they are asleep.

Of course there is non-REM rebound as well, but the brain gives priority to the slow-wave sleep and then to REM, suggesting that the states are independent of each other.

In a 2005 study published in Sleep, Nielsen showed that losing 30 minutes of REM one night can lead to a 35 percent REM increase the next night—subjects jumped from 74 minutes of REM to a rebound of 100 minutes.

Nielsen also found that dream intensity increased with REM deprivation. Subjects who were only getting about 25 minutes of REM sleep rated the quality of their dreams between nine and eight on a nine-point scale (one being dull, nine being dynamite).

Of course, REM deprivation, and the subsequent rebound, is common outside the lab. Alcohol and nicotine both repress REM. And blood pressure drugs as well as antidepressants are also well known REM suppressants. (Take away the dreams and, curiously, the depression lifts.) When patients stop the meds, and the vices, they're rewarded with a scary rebound.

But the persistence of REM begs the question: Why is it so insistent? When rats are robbed of REM for four weeks they die (although the cause of death remains unknown). Amazingly, even though we spend about 27 years dreaming over the course of an average life, scientists still can't agree on why it's important.

Psychiatrist Jerry Siegel, head of the Center for Sleep Research at the University of California, Los Angeles, recently proved that REM is nonexistent in some big-brained mammals, such as dolphins and whales. "Dying from lack of REM is totally bogus," Siegel says. "It's never been shown in any species other than a rat."

Some theories suggest that REM helps regulate body temperature and neurotransmitter levels. And there is also evidence that dreaming helps us assimilate memories. Fetuses and babies spend 75 percent of their sleeping time in REM. Then again, platypuses experience more REM than any other animal and researchers wonder why, because, as Minnesota's Mahowald puts it, "Platypuses are stupid. What do they have to consolidate?"

But, given that rats run through dream mazes that precisely match their lab mazes, others feel that there must be some purpose or meaningful information in dreams.

John Antrobus, a retired professor of psychology and sleep research at the City College of New York says that dream content is tied to our anxieties. But he never found the extreme vividness in REM rebound that others assume is there, based on a higher level of brain activity which likely means more action-packed dreams.

"The brain is an interpretive organ, and when regions are less connected as they are in sleep, we get bizarre narratives," he says. "But its purpose? For that we have to ask what is the purpose of thought. We can't answer one without answering the other."