Sleep has a lot to do with firming up recall for new information. It’s part of why staying up all night studying for a test isn’t as helpful as staying up half the night and still getting a few hours of rest. That I know from reading about scientific studies. I’m not as sure about why taking a day off helps, but I would guess it also has to do with how long term memory is formed. I remember finding that with algebra courses more so than anything else I took in college. If I waited a day or two to start on the homework, it all made sense. If I tried to do it the day of the lesson, I struggled to get it right and had to refer to my notes.