David Eagleman said this quote

The deep secret of the brain is that not only the spinal cord but the entire central nervous system works this way: internally generated activity is modulated by sensory input. In this view, the difference between being awake and being asleep is merely that the data coming in from the eyes anchors the perception. Asleep vision (dreaming) is perception that is not tied down to anything in the real world; waking perception is something like dreaming with a little more commitment to what´s in front of you. Other examples of unanchored perception are found in prisoners in pitch-park solitary confinement, or in people in sensory deprivation chambers. Both of these situations quickly lead to hallucinations.