Your brain doesn't take the night off when you're asleep; it's actually pretty busy while you doze. This is when your brain forms new memories. It also links memories with older memories and consolidates memories for long-term storage. And it does the same with motor skills, too, so if you're learning a new dance or want to improve your swing, don't skimp on sleep — it's when you develop muscle memory. While you're not actually physically making the movements of that new dance while you snooze, you're processing complex information and even making decisions — or at least making the links between information that's important to something in your waking life.
And, as if that's not enough to keep your brain busy while you catch some Zs, this is also the time when your brain takes out the trash. Literally, it's when the body's glymphatic system gets to work, sending cerebrospinal fluid flowing through the brain and removing waste products [source: Xie, et al]. If the brain isn't able to clean up, it leaves you at risk for developing neurodegenerative diseases such as Alzheimer's and Parkinson's.