Empathy never really forms in those sorts to begin with.
The 'why do they stay if they hate me?' question is actually pretty simple when you realise the context in which they view 'relationships'. You are not their partner, you are their victim.
Depending on the degree of malignancy thry have (all npd and similar lack empathy, which is terrifying. But on to of that, some have high rates of malignancy too).
So for example, a narcissist higher on the malignancy scale might act like they hate you, deliberately to hurt you. Because that's how they feed.
But it's important to remember that ultimately all of those sort will hate you, irregardless. Because they are innately jealous, cold, and annoyed that they couldn't assimilate 'you'.
They think they deserve your things, your life, your ability just "be" and be happy in yourself without having to drain other people dry like they do. They hate you because they cannot.
They may even have painted you in their heads as the perfect source to quench their bottomless emptiness. But the fact is, ultimately they are a cup with a hole in them that can never be filled.
They are like robots who want to be real boys.
That's best case scenario. Worst case scenario, higher malignancy rates, they don't want to be you. They just want to hurt you.
Either way, narcissists want to destroy good, kindness, joy, and self love/worth. Because it is an affront to their souls...or rather, the place where their souls would be if they weren't totally empty inside.