31/01/2016 6:42 PM AEDT | Updated 15/07/2016 12:51 PM AEST

Sleepwalking Explained: The Real Reason Why People Do It

riskms via Getty Images
sleeping man walks in pajamas

Sleepwalking. While it may not come exactly in the form of someone shuffling around the house with their arms outstretched like a comatose zombie, it is a real thing that affects children and adults alike.

So why does it happen, and can you make it stop?

"There are lots of old wives' tales surrounding sleepwalking," St. Vincent's Hospital sleep specialist, Dev Banerjee, told The Huffington Post Australia.

"I actually have people who come to me in the clinic and will say, 'my partner sleepwalks -- is he or she possessed or spooked? Is there a voo-doo model somewhere?

"Actually, sleepwalking occurs in a part of sleep called slow wave sleep which is part of non-REM sleep. It's actually loosely termed as the 'deep stage' of non-REM sleep.

"The other term we use for sleepwalking is non-REM parasomnia, which is basically a medical term that describes odd behaviour during the sleep -- and one of those is sleepwalking."

According to Banerjee, the sleep condition -- which is said to affect one in 10 children and one in 50 adults -- could be hereditary.

"It can run in families, so there must be some sort of genetic family link," Banerjee said.

In fact, some research has suggested the condition can be traced back to one section of a single chromosome -- chromosome 20 -- and therefore can be passed down through multiple generations.

Interestingly, Banerjee said that, contrary to popular opinion, sleepwalking has nothing to do with your dreams. In other words, just because you are dreaming about food, it won't prompt you to sleepwalk to the fridge.

"When we are asleep, our bodies are restful and peaceful, though our brain may be active," Banerjee said.

"When we sleepwalk, that association between your brain and body disappears. People do the craziest things. They jump out of bed, but they are not aware they're doing it.

"However, sleepwalking is not dreaming -- you are not acting out what you are dreaming. The brain isn’t aware of what you are doing, but your body is still doing odd things. You could be walking downstairs, going to open cupboards... all without your brain knowing what's going on."

Sleepwalking actually has nothing to do with your dreams.

In terms of what causes sleepwalking, Banerjee says firstly a person has to have a predisposition to the condition, most likely genetically, and then on top of that, they have to be primed.

"One common priming factor is sleep deprivation," Banerjee said. "So if you are deprived of sleep one night, the following night you are more likely to sleepwalk.

"Because what happens is, slow wave sleep occurs only in the early part of the night. If you have a late night, you will miss that slow wave sleep.

"Then the next night, you will have this rebound of slow wave sleep, which will mean you are primed to sleepwalk if you are predisposed to it and if the right triggers occur during the night.

"Triggers include noise -- so if a cat has knocked over a bin or something -- or touch, so if your partner rolls over and bumps you. Sometimes snoring and sleep apnea can be a trigger.

"The point is, there are a lot of factors that determine whether someone might sleep walk, and at the end of the day, sometimes you just can’t predict when it might happen."

If you sleepwalk often and want to reduce the risk of it happening, Banerjee advises that you try to determine what the triggers might be and minimise them.

"Reduce the priming factors. Avoid sleep deprivation. Try and work out what the triggers are. So if you live somewhere very noisy, you might want to buy ear plugs," Banerjee said.

"Or if you have a small bed and a partner, and every time they roll over, they bump into you and trigger parasomnia, think of a bigger bed or a long pillow in-between. In severe cases, in those who injure themselves, there’s medication in the form of a sleeping tablet."

If you're not the sleepwalker but you know someone who is, and you happen to catch them sleepwalking that night, Banerjee says not to try to wake them.

"Don't actively wake them up, because they may respond by thrashing out with their arms and end up bumping you in the nose," Banerjee said.

"Try and redirect them back to bed or couch. The majority of sleep walkers grow out of it, though there is a small proportion who don't."