During sleep the mind is a “remarkable engine of problem solving.”

In the 1960s, as the journalist Alice Robb explains in her forthcoming book Why We Dream, the psychologist David Foulkes theorized that children seldom remember their dreams before age 9. Foulkes continued his research into pediatric dreaming over the decades and in his 2002 book on the topic concluded that humans are dreamless in their first few years of life.

Just because they can “perceive a reality,” he wrote , doesn’t mean they “can dream one as well.” Instead, he found that children don’t start dreaming until they’re a few years old and can imagine their surroundings visually and spatially. Even then, he argued, the dreams tend to be static and one-dimensional, with no characters and little emotion. It isn’t until age 7 or so, according to Foulkes, that humans start to having graphic, storylike dreams; this phase of life is also when children tend to develop a clear sense of their own identity and how they fit into the world around them.

Still, in recent years, there’s been growing scientific recognition of babies’ capacity to “know, observe, explore, imagine and learn more than we would ever have thought possible,” writes the UC Berkeley child psychologist Alison Gopnik. Insight into the science of dreaming has also evolved , with the body of research broadening and challenging some of Foulkes’s conclusions. In 2005, for example, The New York Times published a Q-and-A with Charles P. Pollak, the director of the Center for Sleep Medicine at New York-Presbyterian/Weill Cornell Medical Center. “Yes, as far as we can tell,” he said when asked whether babies dream, noting that “it is a well-based inference” that they do so during the phase of sleep characterized by rapid eye movements, or REM.

REM sleep is when most dreaming occurs for humans. During this phase, the body becomes immobile and breathing and heart rate become irregular. According to Kelly Bulkeley, a psychologist of religion who studies dreams , REM sleep is also believed to help people consolidate their memories and mentally digest them, though sometimes in strange and seemingly illogical ways. Research dating back to the 1960s on the purpose of REM sleep for babies in particular has found that it supports brain development, helping infants to convert their experiences and observations during conscious hours into lasting memories and skills. Perhaps that’s why babies experience much more REM sleep than adults do—about half of babies' sleeping hours are spent in REM sleep, compared with about 20 to 25 percent for older humans . “The commonsense view,” as a result, “is that yes, babies are dreaming—they just don’t have language to be able to communicate that,” Bulkeley says.