"During this phase, what the brain is doing is replaying memories during sleep, so those brain rhythms that occur during slow-wave sleep and other phases of non-REM sleep are actually reactivating those patterns -- those memories -- and replaying them and strengthening them," Gomez added, in the paper published in the journal Child Development.