What happens to people with personality disorders to make them the way they are? Speaking from personal experience, but also saying something that can easily generalize much more broadly, there is a genetic component but it is also triggered. When you are little, instead of developing a sense of your own identity, you learn to think of yourself as a cipher. You do it because there is no advantage to you in being a particular someone (much less the particular person you are), and every advantage in being whatever the situation calls for, in blending in with the background, in being the strings that pull other people rather than being a person yourself. Kierkegaard speaks of something similar:
For every man is primitively planned to be a self, appointed to become oneself; and while it is true that every self as such is angular, the logical consequence of this merely is that it has to be polished, not that it has to be ground smooth, not that for fear of men it has to give up entirely being itself, nor even that for fear of men it dare not be itself in its essential accidentality (which precisely is what should not be ground away), by which in fine it is itself.
***
[But when the sense of self is lost] he may nevertheless (although most commonly it becomes manifest) be perfectly well able to live on, to be a man, as it seems, to occupy himself with temporal things, get married, beget children, win honor and esteem -- and perhaps no one notices that in a deeper sense he lacks a self. About such a thing as that not much fuss is made in the world; for a self is the thing the world is least apt to inquire about, and the thing of all things the most dangerous for a man to let people notice that he has it. The greatest danger, that of losing one's own self, may pass off as quietly as if it were nothing; every other loss, that of an arm, a leg, five dollars, a wife, etc., is sure to be noticed.
***
But while one sort of despair plunges wildly into the infinite and loses itself, a second sort permits itself as it were to be defrauded by "the others." By seeing the multitude of men about it, by getting engaged in all sorts of worldly affairs, by becoming wise about how things go in this world, such a man forgets himself, forgets what his name is (in the divine understanding of it), does not dare to believe in himself, finds it too venturesome a thing to be himself, far easier and safer to be like the others, to become an imitation, a number, a cipher in the crowd.
So a personality disordered person might lose their sense of self, but it can actually be as empowering as it is tragic. Without a self, there isn't the same potential for ego hurt -- we no longer live a life motivated largely by fear. The most vulnerable and valuable part of us has already died. What is left is a cipher, a thing that can take the form and shape of whatever is most convenient in the moment.
GAME OF THRONES SPOILER ALERT
So it's with interest that I wonder where Game of Thrones is going with the Arya plot line. The quick summary is that she is a noble born girl hell bent on revenge for the death of her parents. She's become an accomplished killer, but has also gotten caught up in this sort of cult in which she is being asked to become "no one" -- to leave her old identity behind and instead have the capability of wearing any number of masks and appearing like any number of different people, a lethal assassin. Repeatedly she is asked what her name is, and repeatedly she must answer "a girl has no name" as part of her further depersonalization.
In the books, regarding Arya it says "She could feel the hole inside of her where her heart had been" and "She would be no one if that is what it took. No one had no holes inside of her."
This video explains the psychological changes she undergoes, and how she can hardly function like a person because she cannot trust, all she knows is killing and survival.