Deep sleep sounds restful, but during it our brains are actually working hard. One of the main things the brain is doing is moving memories from short-term storage into long-term storage, allowing us more short-term memory space for the next day. If you don't get adequate deep sleep then these memories will be lost.
Compacting garbage collection.