Excerpted from New Scientist: The Origin of (almost) Everything, written by Graham Lawton and illustrated by Jennifer Daniel.

Within a few hours of reading this you will lose consciousness and enter the twilight zone. For the next few hours your brain will cycle between two wildly different states, deep sleep and rapid eye movement sleep, or REM. For much of that time you will not be totally unconscious but engaged in the bizarre nocturnal state called dreaming.

We spend about a third of our lives asleep, and it is clearly very important. If deprived of sleep for too long, we fall ill; rats kept awake 24/7 die within three weeks. Yet despite more than 60 years of intense study, we still don’t really know what it is for.

It isn’t for lack of trying. Sleep scientists have come up with dozens of hypotheses about its function. These range from keeping us out of harm’s way to saving energy, repairing our bodies and brains, tuning our immune system, processing information, regulating emotions and consolidating memory. Each has strengths – and weaknesses, too. Most sleep researchers accept that sleep has many functions and that all of these hypotheses may be true to some extent.

The lack of an accepted explanation, however, is not just frustrating for sleep researchers. It has also made the evolutionary origin of sleep very hard to discern. It must be very old: all animals with a complex nervous system do it, including mammals, birds, reptiles and fish. We know that dinosaurs slept: in 2004 palaeontologists in China discovered the bones of a 125-million-year-old dinosaur with its head tucked under its forelimb, exactly like a sleeping bird with its head under a wing. It is also possible to identify sleep-like states in animals without a complex nervous system, including insects, scorpions, worms and some crustaceans.

Sleep may even be an inherent property of nerve cells. Groups of neurons grown in a Petri dish spontaneously enter a state very like sleep. Deprive them of their shut-eye and they go haywire, firing rapidly and randomly in an epileptic-like frenzy.

Even microorganisms, which lack a nervous system altogether, have daily cycles of activity and inactivity driven by internal body clocks. The origins of sleep might therefore date back to the dawn of life around 4 billion years ago.

Another stumbling block is that sleep is not just one thing but two. The first is called deep or slow wave sleep because it is characterised by long, lazy waves of undulating electrical activity synchronised across the whole brain. The second is rapid eye movement (REM) sleep, which could hardly be more different. It is characterised by frantic brain activity that looks very much like wakefulness. It also has obvious physical signs: the rapid flickering motion of the eyeballs and near total muscle paralysis thought to prevent you acting out your dreams.

REM sleep is found only in mammals and birds. They last shared a common ancestor about 300 million years ago, which could mean that REM sleep evolved before then. However, that common ancestor also gave rise to REM-less reptiles, which suggests that birds and mammals evolved REM sleep independently.

Where your mind goes at night

REM sleep is also when we do most of our dreaming, the function and origins of which sleep scientists have made much more progress in understanding. Sigmund Freud was the first to suggest that the content of dreams can be influenced by waking experiences. He called these ‘day residue’. Freud’s ideas about dreaming have fallen largely out of favour, but this one – now known as the continuity hypothesis – is still influential.

Dreams seem to hold a mirror to our waking lives. They often reflect recent experiences, particularly new ones. Someone who has just played Tetris for the first time may dream of oblong shapes falling from the sky, for example.

The link between waking and dreaming has also been observed directly by brain scanners, which reveal the dreaming brain replaying patterns of activity that were seen during earlier waking experiences.

Experiences seem to enter our dreams in two separate stages. They first reappear the night after the event itself, and then again between five and seven days later, thus supporting the idea that one of the functions of sleep is to process memories and integrate them into long-term storage.

We do not simply replay events in our dreams, however. They are fragmented, combined with older memories and jumbled into bizarre and emotionally charged narratives featuring impossible events, places and characters. This may simply be due to the brain activity required for memory processing. Visual areas are very active, as are the emotion centres in the amygdala, thalamus and the brainstem. At the same time, the areas which deal with rational thought and attention are quiet.

But memory processing cannot be the whole story. Dream reports gathered from people born with disabilities contain elements that they have never actually experienced. Many deaf people have dreams in which they can hear and understand spoken language; those who cannot speak in real life find their voices. People born paralysed often walk, run or swim. This suggests that, for some reason, the brain is genetically programmed to generate experiences that we can expect to encounter during our lives.

Something similar may explain nightmares. About two-thirds of dreams involve a threat, often a fraught encounter such as running away from an assailant or getting into a fight. Such encounters are even more common among children, and often feature dangerous animals. One explanation for this is that the brain conjures up dreams to simulate challenges that we may meet in real life – or that our distant ancestors would have experienced – allowing us to practise dealing with them.

So when you lose consciousness tonight, beware. The twilight world is full of mystery and danger.

Photos via Flickr / oksidor