“Sleepwalking, also known as somnambulism or noctambulism, is a phenomenon of combined sleep and wakefulness. It is classified as a sleep disorder belonging to the parasomnia family. It occurs during slow wave sleep stage, in a state of low consciousness, with performance of activities that are usually performed during a state of full consciousness.
The cause of sleepwalking is unknown. A number of, as yet unproven, hypotheses are suggested for why it might occur, including: delay in the maturity of the central nervous system, increased slow wave sleep, sleep deprivation, fever, and excessive tiredness. There may be a genetic component to sleepwalking.”
Most sleepwalking episodes last less than 10 minutes, and tend to affect children more than adults. It's known that various factors, including lack of sleep, alcohol, drugs, infections etc can increase the chance of a sleepwalikg episode.
Further information UK NHS