Humans have a stage of sleep that features rapid eye movement (REM). REM sleep makes up around 25% of total sleep time and is often when you have your most vivid dreams.
Thus shall ye think of all this fleeting world: as star at dawn, a bubble in a stream. A flash of lightning in a summer cloud, a flickering lamp, a phantom, and a dream.