Sleep includes several states. Non-REM sleep has stages N1, N2 and N3; N3 is also called deep or slow-wave sleep. REM sleep includes rapid eye movements and is often associated with vivid dreams.
Across a usual night, more N3 tends to occur earlier and REM periods tend to lengthen later. The diagram shows an illustrative pattern, not a timetable that every brain must follow. Brief awakenings can occur too.