To some people, sleeping seems like a robotic process: you shut your eyes, and your brain turns off until the next morning. But in reality when you fall asleep your brain goes into something similar to a "
full system reboot" - because it doesn't have to deal with all the information coming in from the outside world. This reboot includes storing and organising memories, restoring your hormonal levels and even tests your imagination through dreams. During REM (rapid eye motion) sleep, your brain is arguably more active than when you're awake.