BPD is a narcissistic personality disorder. Narcissistic traits put SELF before the world. The SELF is like an internal intellect (see romans ch 7 for an explanation whether you are Xian or not) that affects the outside person. It wants to PROTECT the person in any way it knows how.
Most of the people I knew (7-9) that had traits ;in the BPD behavioural list, were trying to avoid being hurt. Some and I suspect all had suffered abuse of one kind or another as a kid. (Most of us have) And their abuse was such that for whatever reason, the magnitude of the abuse, the severity of emotional impact, or just not “built” physiologically to deal with it, their “inner ME” felt it had to get tougher.
What ends up is the person sort of paints an image of them that they present to the world. Anything that clouds, or distorts that image sends them over the edge at some point. Once over the edge, anything is possible for them to regain where they feel they have a modicum of control again. Up to and including hurting themselves, or others, or hurting themselves to frame another.
Medications can help cope, and fairly invasive/digging/maybe-aggressive counseling can get back to the triggers and then back to the original traumas and help them get past it. Then lots of follow ups to deprogram a whole life of “living a lie”.
I’m not a doctor, I’m not a counselor, I make no claims of expertise. Keep that in mind. I don’t think the description above will set many doctors, or counselors off as long as it’s left in the general, and not scientific explanation standards when read. In other words, that wasn’t written to be technically perfect, but the GIST of the message will give you an idea.