To be perfectly honest, no one knows exactly why people sleepwalk, but we'll talk about some possibilities.
We've mentioned that sleepwalking occurs during your deepest stages of sleep, stages 3 and 4, when brainwaves are very slow. During the day, your brain is a beehive of activity -- during NREM sleep it is barely humming. Your body, however, is still active, and hasn't completely quieted down for the day. So what we have here is a body that can still move, paired with a sleepy brain.
Mental health professionals refer to sleepwalking as a "disorder of arousal," which means that something triggers the brain into arousal from deep sleep, so the person is in a transition state between sleeping and waking.
The fact that most sleepwalkers are children is significant, especially since most of them grow out of it. A child's brain develops very quickly and is primed to soak up all kinds of stimuli. Drooling babies grow into reading kindergarteners in five years -- do you think you'll experience the same kind of brain development in the next five years?
Some suggest that a child's brain is simply too immature to completely understand the cycles of waking and sleeping -- think of sleep as having fuzzy borders. Other propose that since children develop so quickly, perhaps some areas of the brain outpace others in development, or certain aspects of development take precedence.
NREM sleep is also when your body repairs itself and releases hormones, including growth hormones. Children spend a lot of their time growing, and it's possible that the release of hormones has something to do with triggering arousal from sleep.
Most adult sleepwalkers also sleepwalked as children -- it rarely begins in adulthood except as a symptom of another disorder. Children tend to sleepwalk more when they are overly tired or stressed. The same factors affect adults, as well as certain medicines, alcohol and fever illnesses.
Of course, in some people, sleepwalking isn't so harmless. Sleepwalking has been linked to seizures, REM sleep disorders and organic brain disorders like Parkinson's and Alzheimer's. If your child is sleepwalking, he or she will probably either grow out of it or can be helped by a regular sleep schedule and some stress reduction. If you're an adult and start sleepwalking, it might be a good idea to talk to a doctor.