Tzu - That would be the million dollar question! The theory is that these are dream-type states. I haven't read any research that has looked at the content differences of the hallucinations.
What you are describing is sleep paralysis. I used to work as a coordinator in a sleep disorders clinic and we saw this frequently. It is more common in children, but happens with adults also. It normally happens as the patient falls asleep, but can happen upon awakening also. Usually a low dose of klonopin was prescribed before bed.