Popular Science looks at why sleep is crucial to staying healthy and feeling your best.

Many scientists have pondered the question of why sleeping gives our brain such a boost. After all, it’d be ideal if we didn’t need to sleep at all: shut-eye makes animals vulnerable to predators. They think sleep is important for two main reasons: It helps us repair and restore our organ systems including our muscles, immune systems, and various other hormones. And it plays a crucial role in memory, helping us retain what we learned at work or school for later use.

Getting proper sleep, scientists have found, seems to help our immune systems function best. While our body is resting, immune cells known as T-cells spend that time racing around our bodies. Other immune cells also work better with more sleep. Researchers studied how our bodies respond to vaccines—medicine that targets the immune system—after a full night’s rest and after no sleep at all. They found that getting proper sleep the night after a vaccine creates a stronger immune response to the virus a given vaccine is meant to attack.

Other scientists have also looked at how sleeping affects learning and memory. Each day, at work or school, we learn new things. But the ability to recall and use that information later on appears to rely on sleep.