Repression is a Freudian defense mechanism. A defense mechanism is a reaction to an unpleasant thought created by the mind to suppress it.
According to Freud, defense mechanisms suppress these thoughts because they're too painful for the conscious mind to bear. If released, such thoughts could break down the mental structure of the brain, leading to any number of mental defects.
Everyone's heard of Sigmund Freud; the man whose ideas of little children displaying sexual attraction are controversial even in these relatively enlightened times. However, his theories are not completely untoward.
What if I told you that Freud was not completely wrong? Let me explain.
As I stated before, repression is a defense mechanism. But what results in a memory being repressed? Well, there is often a strong emotion associated with the memory - be it pain, sadness...
Fear is the strongest of all human emotions. This is because, since days of old, we have been programmed to respond to threats with a 'fight or flight' response. This is mentally manifested in fear, the primal urge to eliminate or escape a threat.
Like I mentioned earlier, memories are repressed because the knowledge of such an event occurring is too unpleasant to bear.
However, there are ways to recover these memories, mainly through 'free speech therapy' - the old 'lie-on-the-couch-and-tell-me-your-problems' situation. But, here's the clincher:
They can also be accessed through dreams.
Once again, according to Freud subverted memories often manifest themselves in dreams. Unconscious emotions, memories, can present themselves during what you think is your time of rest... safety... comfort.
This is why such experiences often result in you waking in the deep of night, strongly distressed. Nightmares in which the darkest demons present themselves are not alien to you; they are simply... released.