People sleepwalk because during deep sleep, especially in a stage called N3 or non-REM sleep, the brain can partially wake while the body remains asleep and active. This causes physical activity, like walking, while the conscious mind is still asleep. Sleepwalking often happens due to a combination of genetic predisposition, lack of sleep, stress, fever in children, medication, alcohol, sleep disorders like sleep apnea or restless leg syndrome, and sudden awakenings from deep sleep. The exact mechanism involves a disconnect between brain and muscle signals that normally prevent movement during dreaming. High serotonin levels and failure of the brain's chemical paralysis during REM sleep may also play a role. Most commonly, sleepwalking occurs in children and tends to decrease with age. It can be triggered or worsened by sleep deprivation, stress, and uncomfortable sleep environments.