New babies have extremely short sleep cycles, or periods of deep, light and REM sleep.
Throughout the night, the cycles of REM sleep get longer and the sleep gets deeper.
The importance of REM sleep is essential to cognitive processing.
Generally the theory is that the relaxed mind during REM sleep has the opportunity to process memories and feelings about experiences from when the dreamer was awake.
Dream research continues to fine tune the previous theories as scientists uncover more and more about the brain's functions during REM sleep and as scientific measuring equipment improves.