Disclaimer: I'm just an...interested layman, but as far as I know we don't really know. It looks like there's both genetic and environmental components to it; your genes have a big impact on your "temperament" and more volatile temperaments correlate more strongly with cluster B disorders. But it seems like neglect, a failure to recognize a child as their own independent person (basically "my needs are your needs"), from parents/caregivers who are often themselves narcissists contributes pretty strongly, too.
The Little Shaman[1] has been one of the most comprehensive-yet-approachable resources I've found for understanding these kinds of high-conflict personalities. In particular [2-4] are pretty relevant to your question.