A baby needs up to 17 hours sleep for their rapidly developing brain and body. Sleep helps develop motor skills and dreams help with learning.
There are two phases of sleep. NREM is deep sleep and transfers memories. REM is dream sleep that takes new memories and makes sense of them.