Zoë Heller writes in The New Yorker:

Science has long understood that rem sleep—the stages of sleep characterized by rapid eye movement, in which most dreaming takes place—plays a vital role in our mental health. The human need for REM is so uncompromising that, when it is inhibited over a long period by excessive alcohol use, the pent-up backlog will release itself in a form of waking psychosis, otherwise known as delirium tremens. For a long time, the scientific establishment suspected that dreams were a superfluous by-product of the REM state. But in recent decades, thanks in large part to the advent of brain-imaging machines, scientists have been able to establish that dreams themselves are essential to the benefits of REM sleep. First, dreams knit up the ravelled sleeve of care by allowing us to process unhappy or traumatic experiences. Typically, during the REM state, the flow of an anxiety-triggering brain chemical called noradrenaline is shut off, so that we are able to revisit distressing real-life events in a neurochemically calm environment. As a result, the intensity of emotion that we feel about these events in our waking lives is reduced to manageable levels. In “Why We Sleep,” Walker attributes the recurring nightmares of P.T.S.D. sufferers to the fact that their brains produce an abnormal amount of noradrenaline, preventing their dreams from having the normal curative effect. When the dreaming brain fails to diminish the emotion attached to a traumatic memory, it will keep trying to do so, by revisiting that memory night after night.

Dreams also help us to master new skills; practicing a task or a language in our sleep can be as helpful as doing so when we are awake. And they appear to be crucial in honing our capacity for decoding facial expression: the dream-starved tend to slip into default paranoia, interpreting the friendliest expressions as menacing. Perhaps most alluring, dreams help us to synthesize new pieces of information with preëxisting knowledge, and to make creative lateral connections. The long list of inventions and great works said to have been generated in dreams includes the periodic table, the sewing machine, Coleridge’s “Kubla Khan,” Paul McCartney’s “Let It Be,” and Mary Shelley’s “Frankenstein.”