Antonio Zadra, a psychologist, is sharing a memory of a horrific experience at sea. He had almost made it to shore, but knew he was about to die. In fact, these were his final 20 seconds of life. Just then, his eight-year-old son appeared at the water’s edge. He looked at Zadra, and Zadra heard the words: “Dad, no!” Two years later, remembering the fear and horror of the moment makes him well up. “I was thinking: ‘I am about to die and I am going to die in front of my eight-year-old son.” He recalls the vivid depth in his son’s eyes, the completeness with which he was able to look into them. And then, of course, he woke up and everything was OK, but not OK. The first thing he did in the morning was hug his son.

Zadra says this is his worst anxiety dream; one that still has the power to take his breath away. And, having read more than 10,000 dream reports for his work at the Center for Advanced Research in Sleep Medicine at the University of Montreal, he knows that his dream contains one of the most common motifs of anxiety dreams: that of our own imminent death (others include chase and pursuit, and loss of control). But this knowledge did nothing to ameliorate the shock and anguish of the moment. Technically, the only thing that stops this dream from being classified as a nightmare is the fact that it didn’t wake him up.

It is not surprising that anxiety seeps into our sleep. We live in anxious times. According to the World Health Organization (WHO), depression and anxiety disorders cost the global economy $1tn a year, with a 50% increase in the number of people with depression or anxiety between 1990 and 2013. In the US, general anxiety disorder affects 6.8 million adults and sales of books on anxiety are up 25% year on year at Barnes & Noble. In the UK, the Office for National Statistics’ national wellbeing survey last month showed that 17.8% of the population reported “some evidence indicating depression or anxiety”. So does the rise in our awareness and reporting of anxiety make us more likely to have anxious dreams? And do anxiety dreams – even the worst ones such as Zadra’s – bring any lasting benefit?

In fact, most dreams contain elements of anxiety. About one-third of all dream reports in Calvin Hall and Robert Van de Castle’s seminal 1966 work, The Content Analysis of Dreams, contain “misfortunes” of some kind. According to G William Domhoff, a sociologist and psychologist who worked with Hall, and who later analysed the dream reports, 80% of men’s dreams and 77% of women’s dreams feature at least one of the “negative elements” of sadness, anger, confusion and apprehension. “On the other hand, only 53% of dreams for men and women have at least one of several positive elements, such as friendly interactions, good fortune, success and happiness,” he adds.

In other words, says Isabelle Arnulf, a neuroscientist and president of the French Society for Sleep Research and Sleep Medicine, “it is normal to have anxious dreams”. But lots of her patients talk about anxiety dreams, worried that “they are abnormal”. No wonder the word people most commonly use in their sleep is: “No!”

“We have always had a proportion of people who contact us saying their dreams bother them,” says Nicky Lidbetter, the chief executive of the charity Anxiety UK, whose own anxiety dreams tend to centre on being stuck in traffic (she is agoraphobic). But she and her colleagues have not noticed an increase in the number of people reporting them. While research has shown that people who have experienced trauma go on to experience trauma-related anxiety dreams, those who suffer general anxiety in their waking hours are not necessarily more likely to have anxious dreams. “It’s not just being more anxious that makes you likely to have anxious dreams,” Zadra says. “It’s being more anxious and finding yourself in a stressful situation.”

The correlation between waking anxiety and anxiety dreams is complex. Mark Blagrove, a professor of psychology at Swansea University and head of its sleep lab, has measured “nightmare distress”. He says that anxiety not only causes dreams to be “more negative, but you then get a worse reaction to the negative dreams because you are anxious”. In another anxiety double-bind, daytime stress can lead to sleep deprivation and more regular night-waking, which can in turn lead to an increase in the number of dreams we recall.

But do anxiety dreams have a function? Arnulf, who experiences them before important meetings, thinks that they do. In 2014, she led a study of students taking the Sorbonne medicine exam. It is extremely competitive – fewer than 10% of those tested are admitted. She and her team asked examinees to complete a survey about how they slept the night before the exam.

Between them, the students had experienced almost every imaginable examination-related dream. Some couldn’t find the examination hall; others were late. Many dreamed that they ticked the wrong box in answer to the first question, thereby rendering every subsequent answer wrong. One dreamed that their walls and curtains were covered in chemical formulae and another raised their hand for paper and was given sliced bread. All kinds of transport disasters surfaced: trains didn’t turn up, operators went on strike.

This last, Arnulf says, is such a common daytime worry that many students book a hotel room near the Sorbonne to circumvent waking-world transport problems. “But even those students,” she says, “would dream that they woke to go to the bathroom only to find a queue of people … and then they were late for the exam.”

Arnulf’s favourite anxiety dream of those she studied was from a female student who dreamed she was revising, but could no longer remember an important detail about the spinal cord. She awoke in the middle of the night, went to her desk and opened her textbook at the appropriate page. Realising that she didn’t know the detail in question, she started to revise.

One suspects Arnulf likes this one because it is the most narrative illustration of the correlation her research unearthed: that the students who had the most anxiety dreams the night preceding the exam scored the highest marks. “Whatever happened in their brain during the night before, it gave a cognitive gain compared with the other students,” she says. Her team of statisticians equated the gain to half a point, which, given that the average score for the test was seven, is sizable. (This statistic has inspired a number of enterprising students to ask Arnulf which dreams are the most beneficial.)

Arnulf’s findings tally with something called the “threat simulation theory” of dreaming, which holds that people rehearse frightening situations in their dreams and that the rehearsal equips them to face those situations in waking life. If you dream of facing a lion and in the morning happen to meet one, the theory is that you will be better prepared for the encounter. A more evolved version of this is “social threat simulation theory”, which centres on the idea that dreams prepare us for social stress.

These theories are appealing because they help to make sense of the way we might (if only we could be sure) make sense of things in our sleep. But why, then, is the most common anxiety dream that the Anxiety UK helpline receives related to exam crises when most callers are long past the throes of exams? Why am I, for that matter, still dreaming that I am failing to memorise quotations from Henry James 22 years after I committed them to what has turned out to be my short-term memory?

Exactly, says David Bell, a psychoanalyst at the Institute of Psychoanalysis. He says that dreams following severe trauma are often recurrent and undisguised, which suggests that “if [anxiety dreams] are an attempt to prepare us, it is remarkable how consistently this attempt fails”. He adds that Freud believed there may be a kind of default, which means “you end up repeating again and again, without growth or management, the same traumatic event”.

In this scenario, the repeated nightmare is almost a glitch in the dreamer’s system. Of course, it is not only traumatic dreams that are repeated. I often dream that I have just moved into a new home needing a lot of refurbishment only to find a hidden extra room and then lose it, spending the rest of my dream trying to find it again. But what might this mean, I wonder? Bell can’t say because he doesn’t know me, but, as a starting point, he suggests that this kind of dream makes him ask: “Does the person feel that they have done some damage somewhere and they need to repair it – the total refurbishment?” (I have always assumed the dream literally expressed the fact that I would like a room of my own, along Virginia Woolf’s lines.) In other words, dreams communicate our unconscious preoccupation. Recurrent exam nightmares, for instance, may represent the fear of being exposed or humiliated for some guilty, dark thought.

Then again, it is possible, as Blagrove from the Swansea sleep lab, says, that there is no adaptive function to this or any dream: “We simply dream of these things happening because they’re on our mind during the day, so they stay on our mind when we sleep … It doesn’t do anything for us. It’s just that the brain doesn’t completely shut down.” He veers between believing that anxiety dreams have a function and no function at all.

Zadra, on the other hand, believes that some bad dreams do have a lasting impact. He points out that, except in the case of people with post-traumatic stress disorder, only between 1% and 2% of all dreams recalled include exact replays of things we have seen. Instead, dreams often have bizarre or unusual structures or conflate seemingly disparate experiences and characters. Zadra is convinced that “whatever functions dreams have, they get executed when the dream is taking place … and probably more at cortical levels, outside our immediate awareness, where our brains try to relate current concerns with established networks of past experiences to see what associated memories are relevant to recent events”.

Our ability to recall our dreams “has no bearing” on their function, he says. If remembering our dreams were important, he argues, we would remember more of them. After all, most of us have one and a half to two hours REM sleep a night – the phase in which dreams mostly occur – yet “we remember a very small fraction of our dreams”. Regarding his near-drowning experience, he says he has “little to no idea what the ‘purpose’ of that dream was in terms of underlying neuronal activity – but I can certainly tell you the clear message that it left me. Do not take your most cherished things in life for granted and do take the time to savour and love all that is important to you.” This particular dream, he says, “pushed me into taking a step back”.

He also believes that “sleep is very important to consolidating memories and even learning new skills”, whether emotional, cognitive or even physical. A study of German athletes, for instance, found that nearly 10% of them felt that they could use their lucid dreams (when the dreamer is aware that they are dreaming) to practise aspects of their performance. Sleep can also hone emotional gains. One friend, who saw a psychoanalytical psychotherapist after making the difficult decision to have an abortion, describes how each week after her session, she would dream “by numbers”. She was in the bathroom, someone was on the floor and she was killing them. “It was like a parody of a dream,” she says. She felt she was dreaming to order for her therapist, who told her this was “a rite of passage”. After a while, these dreams gave way to others and provided a gateway to a deeper discussion.

After all, even Blagrove, who is not convinced of the function of dreams, believes in their usefulness. “We are producing a whole complicated film while we sleep,” he says. He likes the film analogy because of the way that dreams invite retelling and discussion, and because the prevalence of metaphor in dreams – people falling down holes or endlessly running, or in the case of another friend, caring for an ever-diminishing baby – spurs a search for meaning.

At the Swansea sleep lab, Blagrove and his students recently asked participants in their research to keep a diary and evaluate the emotional intensity of their experiences. They then woke them up in the sleep lab and asked them to describe their dreams. The researchers printed the dreams on one side of A3, the dreamer’s diary on the other and studied the way that waking-life events were incorporated into dreams. They found that “the more intense the emotion, the more likely it was to appear in a dream”, Blagrove says. He recently dreamed that he was tweeting in upper case, even though he knows this is considered discourteous. He was able to map his dream to a family trip to the theatre when he became stressed about returning late from the interval.

If none of this makes you feel any better about anxious dreams, and you are disinclined to explore their meaning alone or with professional help, you could investigate image rehearsal therapy, which trains dreamers to rescript their dreams to render them undisturbing. Most psychoanalysts would see this as a contamination of good material, but Arnulf, a neurologist, thinks the meaning of dreams is irrelevant. The key, she says, is that “you must get to the end of the dream”. Waking up “interrupts a good process”. So try to sleep better generally and your dreams should become more bearable and, who knows, maybe even useful.

For confidential help with anxiety issues, contact Anxiety UK