Perhaps in the fanfiction, Bellatrix stabs Hermione as a way to get to Harry Potter. She might think that by harming Hermione, she can draw Harry out and into a trap. Hermione is one of Harry's closest friends, so this would be a strategic move on Bellatrix's part.
It could also be that in the story, Bellatrix stabs Hermione during a chaotic battle. The heat of the moment, the confusion, and Bellatrix's bloodlust lead her to lash out at Hermione. Maybe Hermione was in the wrong place at the wrong time, or she was trying to protect someone else when Bellatrix struck.
One possible scenario is that Snape steps in during a confrontation. Bellatrix is about to harm Hermione, and Snape, using his quick reflexes and advanced magic, stops her. He could be acting out of his own sense of right and wrong, or perhaps because he has a hidden agenda that involves keeping Hermione safe.
One reason could be pure hatred. Bellatrix despises Muggle - borns, and Hermione being a very intelligent and powerful Muggle - born would be a prime target for her wrath. Another could be jealousy. Hermione's skills and knowledge might make Bellatrix feel inferior, leading her to lash out.
In some fanfictions, there's a scenario where Bellatrix infiltrates Hogwarts. When she comes across Hermione in the library or a corridor, she screams 'Mudblood' to try and disrupt the peaceful environment of the school. It could also be in a situation where Hermione is being held captive by the Death Eaters, and Bellatrix uses the term to break Hermione's spirit.
One possible plot could be that Bellatrix captures Hermione and tries to torture her for information about Harry. But Hermione, using her wits and some new-found powerful magic she has been secretly studying, manages to turn the tables and kill Bellatrix in self - defense.
One possible motive could be jealousy. Bellatrix is extremely loyal to Voldemort, and Hermione is a very powerful and intelligent witch from the side opposing Voldemort. Bellatrix might see Hermione as a threat and also be jealous of the attention Hermione gets from Harry and Ron. So, she tortures Hermione to try and break her spirit and prove her own superiority.
In the original Harry Potter story, Bellatrix doesn't actually stab Hermione. So in the fanfiction, this is a major deviation. It changes the relationship dynamics between the characters. For example, in the original, Hermione and Bellatrix have their tense encounters but not to this extreme level of physical harm.
Well, it could be that Draco betrays Hermione's academic trust. Since they are in a world where magic and knowledge are highly valued, he might steal her research or ideas for a spell or a magical discovery. This would be a huge betrayal as Hermione values her intellectual pursuits greatly. Also, he could betray her trust regarding a secret mission they are on together. He might abandon her in a dangerous situation, like in a dark forest full of dangerous magical creatures or in an old, enchanted castle filled with dark magic traps, just to save his own skin.
Perhaps in a situation where a magical artifact is about to explode and destroy everything around it. Harry, being closer to it, decides to contain the blast instead of letting Hermione get hurt. His selfless act of heroism in this 'harry died for hermione fanfiction' is a way to show his deep bond with her, even if it means sacrificing his own life.
One possible scenario could be during a battle at Hogwarts. Maybe the Death Eaters target her specifically, and she gets hit by a dark curse while trying to protect her friends. Another could be in an accident in the Forbidden Forest. She might be exploring and stumble upon some dangerous magical creatures, like a centaur gone wild, and get injured in the encounter.
Perhaps it's about the idea of corruption. Bellatrix, being on the dark side, might be obsessed with Hermione as a symbol of the light side that she wants to taint. In fanfiction, it could be a way to show the struggle between good and evil in a more personal and complex way. Also, Hermione's courage in the face of danger might be something that attracts Bellatrix's attention in these fictional stories.