Sleepwalking is a type of sleeping disorder called a parasomnia. It generally occurs when you're in deep sleep, also known as slow wave sleep. This means that you wont be having vivid dreams like you experience during REM sleep so sleepwalkers aren't in the middle of a dream while they're walking around.
Sleepwalkers aren't exactly unconscious, it's more that their brains are in a very restful state and the conscious part of it is not engaged. This is why you may appear to be awake but you won't remember the sleepwalking episode occurring
We don't really know why our brains mis-function like this sometimes. We do know that it occurs more often in children and there is a genetic component, children of sleepwalkers are more likely to sleepwalk themselves.
It's possible that the chemical that stops your brains motor system from engaging while asleep isn't working properly. More research is being done