Why does sensory deprivation cause hallucinations? John C. Lilly performed the seminal experiment about sensory deprivation. The author isolated people in a sensory deprivation tank and they reported having experienced hallucinations.  

Richard Feyman reported about his own experiences with isolation tanks in the collection of essays Surely You're Joking, Mr. Feynman!

I am curious about the reason of this effect. If we are deprived of our senses (being perfectly sane and without drugs), why do we start to hallucinate? What happens inside our brains?
According to the article The Brain’s Voices: Comparing Nonclinical Auditory Hallucinations and Imagery (Linden et al. 2011):


  Spontaneous activation of sensory areas (Hunter et al. 2006) has been described in cases of sensory deprivation or during epileptic seizures. Local spontaneous activity may underlie certain types of hallucinations, for example, visual hallucinations of Charles Bonnet syndrome (Ffytche 2005) and possibly imagery of music without lyrics (Kraemer et al. 2005). 


An example, from Neural activity in speech-sensitive auditory cortex during silence (Hunter et al. 2006) states that the auditory cortex has a propensity to spontaneously “activate” during silence.  Specifically, from their study


  suggest that, within auditory regions, endogenous activity is modulated by anterior cingulate cortex, resulting in spontaneous activation during silence. Hence, an aspect of the brain's “default mode” resembles a (preprepared) substrate for the development of auditory hallucinations. These observations may help explain why such hallucinations are ubiquitous.


In the article Visual hallucinations in psychologically normal people: Charles Bonnet syndrome (Teunisse et al. 1996), states that this syndrome, where healthy people can experience visual hallucinations undergoing sensor deprivation, is more common than first realised, their study suggests that under conditions of sensory-deprivation, the slightest amount of arousal triggered the hallucinations.

This is discussed further in Spontaneous and driven cortical activity: implications for computation (Ringach, 2009), where their study suggests


  the lack of a stimulus generates a weak feedforward drive and the cortical state is determined largely by its own intrinsic dynamics and top-down expectations. This explains why spontaneous activity is not noise. Further, if the attractor has been shaped (via evolution or developmental rules) to represent the manifold of natural signals, it is easy to see how sensory deprivation or weak input can lead to “hallucinations” during deprivation 




Additional references:

Ffytche D, Visual hallucinations and the Charles Bonnet syndrome. Curr Psychiatry Rep 2005;7:168-179. 

Kraemer D, 
Macrae C, 
Green A, 
Kelley W
. Musical imagery: sound of silence activates auditory cortex. Nature 2005;434:158.