A painful, traumatic events in a person's life can lead to tremendous emotional and mental disruption.
As a result, along with developing post-traumatic stress disorder (PTSD) or other psychiatric disorders, a person may also develop something called a "dissociative disorder", as a means of coping with the trauma.
The trauma itself may be too difficult to confront, and therefore, the person may slip into a dissociative state in order to escape. In a sense, dissociation can be an adaptive, self-protective way in which a person manages extreme stress and personal threats. However, in the long term, dissociation can further disrupt and impair a person's life and functioning.
here is a youtube video showing the different "personnalities" of a person suffering of dissociation