The swarm of insects — sometimes gnats, sometimes wasps or flying ants — arrived early in this year of nightmares. With summer came equally unsettling dreams: of being caught in a crowd, naked and mask-less; of meeting men in white lab coats who declared, “We dispose of the elders.”

Autumn has brought still other haunted-house dramas, particularly for women caring for a vulnerable relative or trying to manage virtual home-schooling.

“I am home-schooling my 10-year-old,” one mother told researchers in a recent study of pandemic dreams. “I dreamed that the school contacted me to say it had been decided that his whole class would come to my home and I was supposed to teach all of them for however long the school remained closed.”

Deirdre Barrett, a psychologist at Harvard Medical School and the author of “Pandemic Dreams,” has administered dream surveys to thousands of people in the last year, including the one with the home-schooling mother. “At least qualitatively, you see some shifts in content of dreams from the beginning of the pandemic into the later months,” Dr. Barrett said. “It’s an indication of what is worrying people most at various points during the year.”

Dr. Barrett is the editor in chief of the journal Dreaming, which in its September issue posted four new reports on how the sleeping brain has incorporated the threat of Covid-19. The findings reinforce current thinking about the way that waking anxiety plays out during REM sleep: in images or metaphors representing the most urgent worries, whether these involve catching the coronavirus (those clouds of insects) or violating mask-wearing protocols. Taken together, the papers also hint at an answer to a larger question: What is the purpose of dreaming, if any?

The answers that science has on offer can seem mutually exclusive, or near so. Freud understood dreams as wish fulfillment; the Finnish psychologist Antti Revonsuo saw them as simulations of pending threats. In recent years, brain scientists have argued that REM sleep — the period of sleep during which most dreaming occurs — bolsters creative thinking, learning and emotional health, providing a kind of unconscious psychotherapy. Then again, there is some evidence that dreaming serves little or no psychological purpose — that it is no more than a “tuning of the mind in preparation for awareness,” as Dr. J. Allan Hobson, a Harvard psychiatrist, has said.

The four new studies are rooted in a more straightforward idea called the continuity hypothesis. This framework holds that the content of dreams simply reflects what people thought, felt and did during the day — the good and the bad, the hopeful and the frightening. In one study, Cassidy MacKay and Teresa DeCicco of Trent University in Canada compared dream journals kept by students in the first two weeks of the spread of the coronavirus in North America to the journals of students logged before anyone had heard of Covid-19.

The researchers categorized each image, using a standardized measure, into types such as body parts, animals, food and medical objects. The differences in the early pandemic logs jumped out.

“People were clearly thinking about coronavirus-related events, like waiting in grocery lines, and had heads in their dreams, the body part associated with catching and spreading the virus,” Dr. DeCicco said.

People with persistent waking anxieties also tended to play out scenarios involving future work, relationships and life generally in their heads over the course of a day. Previous research has correlated this pattern to scene-shifting in dreams: the frequent changing of the setting, from indoors to outdoors, city to country, mountains to coast. Dr. MacKay and Dr. DeCicco found that dreamers during the first phase of the pandemic recorded far more such shifts in their REM mini-dramas.

“These are classic anxiety dreams,” Dr. DeCicco said.

In another of the studies, Dr. Barrett recruited nearly 3,000 people online to track, describe and write about their dreams in a digital form. She assessed the content of those essays, using a language-analysis algorithm that maps words onto categories like “anger,” “sadness,” “body,” “health” and “death.” These dreams, too, had all the hallmarks of heightened waking anxiety, but emotions like anger and sadness were much more prevalent among women than men.

“I wasn’t expecting this, but the findings suggest to me this idea that men are mainly experiencing fear of getting sick and dying, health fears,” Dr. Barrett said. “Women have been weathering more secondary effects; they tend to be the ones nursing sick family members, more often than males, for instance. I suspect this is the single most likely reason that sadness is up for women in these times.”

Not all the dreams, in either study, were infused with darkness and fear, and many were pleasant, involving reunions with friends or family, or featuring the containment and elimination of the virus. They included wishes and threats, healthy measures and mistakes, and adjustments to news of the spread: learning and emotional processing. There were also periodic injections of hope.

“I dreamed that SARS-Cov 2, as proteins, make music and so, to find the cure, scientists had to compose a melody that fit with the one SARS-Cov 2 produced,” one respondent wrote in Dr. Barrett’s survey. “Then they injected this as a vaccine and people get well.”

In short, the studies suggest that dreaming does not serve just one purpose but many, likely including most of the above explanations from theorists. Dr. Hobson’s warming-the-circuits idea is equally impossible to rule out, given all the dream activity that qualifies as mental gibberish and defies even the cleverest of metaphor-makers.

For everyday dreamers during the pandemic, it may be enough to know that Covid-19 nightmares, like any others, tend to be emotionally over-the-top. “It was scary in the dream, but you wake up and it’s funny,” Dr. Barrett said. “The crisis is smaller than you thought.”

The whole class of schoolchildren isn’t invading your house. The hazmat suits aren’t standing outside the door. We may get through this after all.