The average human spends 26 years of life sleeping. That's a lot of z's, and for what? Interestingly, the question of why we sleep is one of the great mysteries of biology.

Most theorists believe that sleep is of particular importance to the health of the brain or the nervous system. After all, the effects of sleep deprivation usually take a mental toll, often in the form of memory loss, hallucinations or even seizures. Interestingly though, every animal ever studied needs to sleep in some capacity, regardless of the size of its brain or the complexity of its nervous system.

So what gives? Well, a few breakthrough brain studies from the University of Wisconsin may finally offer some answers. In short, we need to sleep to remember and to forget.

Research published in July 2016 and spearheaded by Giulio Tononi of the University of Wisconsin-Madison represents the best evidence yet of what happens when we sleep, reports New Scientist. Tononi's team took slices from the brains of mice before and after sleep. They found that synapses, or connections between neurons, were 18 percent smaller when sampled after a period of sleep. In other words, it seems that the connections between neurons in our brains are being trimmed or weakened while we snooze.

It may seem anti-intuitive to think about shrinking of the brain as a good thing, but it turns out that a slimmer brain has more room the following day to make new memories, according to a February 2017 study. Researchers hypothesize that sleeping allows us to "prune" our memories and fine-tune the lessons we've learned while awake, Science Alert reports. Sleep keeps the mind open to new experiences, and to building memories of those experiences.

“Sleep is the price we pay for learning,” explained Tononi.

The theory explains why we find it harder to concentrate and learn new information when we miss a night's sleep. It's because the brain has reached its capacity, so to speak; it needs to be pruned.

Previous findings are also consistent with this theory. For instance, EEG recordings have shown that the human brain is less electrically responsive at the start of the day than at the end, suggesting that the connections may be weaker.

If Tononi's research makes you frightened to sleep for fear of having your experiences trimmed off, not to worry. The research also found that some synapses were protected from the trimming process, always remaining robust. These areas are probably where the most important memories are being stored.

“You keep what matters,” reassured Tononi.

Though naturally, that leaves open the question of what matters, and how the brain determines what matters. But that's a mystery for another day.

Editor's note: This story has been updated since it was originally published in July 2016.