Sleep is much more than simply resting. During deep, slow-wave sleep, your body and brain perform many of their most important overnight recovery processes. Research shows that deep sleep supports memory consolidation, learning, healthy immune function, tissue repair, hormone regulation and metabolic health.
This is also the stage of sleep most closely associated with the brain's natural waste clearance system, known as the Glymphatic system, which helps remove metabolic byproducts that accumulate during the day. (NHLBI, NIH)
https://www.nhlbi.nih.gov/health/sleep/why-sleep-important