For toddlers, life is full of new experiences. Researchers have now added a whole new milestone to the long list of changes tiny humans go through – a dramatic change in brain function that gives sleep a critical purpose.

Decades of study on the importance of sleep in brain development and maintenance have given us a pretty good idea of the necessity of a decent amount of shut-eye.

Now US researchers have fleshed out our understanding of sleep's major functions by developing a mathematical model that reveals how we undergo a shift in sleep behaviour as we leave the baby years behind.

"I was shocked how huge a change this is over a short period of time, and that this switch occurs when we're so young," says Van Savage, an ecologist and evolutionary biologist from the University of California, Los Angeles.

"It's a transition that is analogous to when water freezes to ice."

While sleep is one thing we all personally experience on an almost daily basis, there is still plenty we don't understand. Just to make matters worse, the closer we look, the more complex this function appears to be.

"Presuming that sleep evolved to serve some primary function, it is almost certain that multiple physiological functions have piggy-backed onto this pervasive and time-consuming feature of animal life," Savage and his team write in their report.

A major part of the sleep process is the entering of a state of consciousness cued by the shifting of our eyes as we dream, called rapid eye movement (REM).

In adults, this tends to kick in about an hour and a half after we've nodded off, and seems to be associated with the consolidation of experiences we've had while awake, locking them into our memory banks.

Sleeping newborns spend roughly half of their time in this state, while by age 10 the REM phase makes up roughly a quarter of their sleep. Past the age of 50, as little as 15 percent of a sleep period includes this memory-forming dream phase.

We might imagine babies need REM sleep to beef up their developing brain, packing it with experiences that will help them hit the ground running once they find their feet.

What's going on the rest of the time, then? This down time is a good opportunity for the body to carry out a general sweep of detritus and make repairs. Not getting enough of it seems like a good way to accumulate waste that raises the risk of future neurological damage, like dementia.

But for all we know about sleep patterns, we're short on comprehensive models that might help us better understand how and why it evolved in the first place.

Combining their expertise in neuroscience, biology, and mathematics, researchers used data from dozens of sleep studies to work out if general relationships between time spent in REM sleep and body sizes reflect some deeper rule on how we develop.

They found evidence of a connection in body mass with respect to the scaled amount of sleep time. In tiny humans, the brain grows quicker than the rest of the body, requiring a lot of focus on building connections.

Yet the relationship between brain growth and a need for maintenance is proportional. Once the brain is more or less built, sleep mostly just needs to do upkeep in relation to its size.

Preliminary measurements from three other animals were also included, providing some insight into the development of rabbits, rats, and guinea pigs.

The analysis revealed a surprising amount of consistency across the species, with the potential for a marked decline in REM sleep at the developmental equivalence of a human at two and a half years. That this change is so well conserved suggests its function may be critical for mammalian development.

It's too early to draw any strong conclusions from the model on mammalian development in general, or know whether it can be applied even more broadly to other animals.

But having a mathematical approach like this opens research to testing whether a major transition in the primary purpose of sleep is a common stage of development throughout the animal kingdom, or if human toddler brains are special in this regard.

"The brain is doing something really amazing and very different during that period," says Savage.

"What are the consequences of that, in terms of our ability to learn languages or adapt our brains to different situations?"

There's a lot going on inside that tiny head. Just one more reason to make sure they – and you – get a good night's sleep as often as possible.

This research was published in Science Advances.