Your Brain Replays Memories While Sleeping
Your brain actually finishes learning while you are asleep. It takes short-term information and stabilizes it into long-term storage by repeatedly replaying your daily experiences in fast motion.
During deep sleep, your neural circuits fire in the same patterns as they did while you were awake, but at a much higher speed. This process effectively cements new skills and facts into your mind for permanent retrieval. Without this nightly mental review, your brain would struggle to hold onto anything new. It is essentially an automatic biological backup system for your life.
Source: Memory consolidation