Yandere/Analysis

A possible origin of the Yandere trope
Yandere may have emerged as a Deconstruction of the Yamato Nadeshiko archetype: a perfect, obedient woman, who has no priorities of her own, except the ones of her family and her husband. A yandere is all that, only driven to logical extreme and then examined realistically: a sentient individual put in such position would invariably experience enormous strain. No wonder that sooner or later she would snap at a slightest provocation. Ironically, it is this realistic take that makes a yandere so endearing to the audiences, often even more so than the traditional Yamato Nadeshiko. (Granted, there would realistically be a wide range of possible responses other than going Axe Crazy, but this one is definitely the most entertaining to watch!). Compare with the Violently Protective Girlfriend who can become Axe Crazy when the love interest is in danger but is otherwise MUCH more stable mentally. See also Living Emotional Crutch for a reason why she goes from affectionate to murderous.

Why Yandere can be perceived as attractive
Interestingly, these types of characters can still be perceived as attractive if they can build up enough tragic audience sympathy, despite the argument that many originally become popular by being subversions of wishy-washy female characters until the fandom ended up loving them in the typical way (what sweethearts!). Sometimes this can actually play out in story, if the Love Interest ever starts to rethink his relationship with this girl, she might threaten to harm him or even herself if he ever leaves her. This threat might be explicit, but often is more subtle.

There is a guide how to win a yandere and live with her. Be warned, once she falls for you (or rather, YOU for HER) there is no turning back. And God help you if you get stuck in a Psychotic Love Triangle. We all know how those go down.