In some fanfictions, Hermione could be attacked by a new, unknown magical creature that has been unleashed by an evil force. She might be left for dead because the attacker believes she is already dead or simply doesn't care. It could also be that she is betrayed by someone she trusts, like a fellow Hogwarts student who has turned to the dark side, and they set her up to be attacked.
Well, she could be lured into a trap by a false message. For example, she receives what she thinks is an important summons from Dumbledore's old contacts, but it's actually a ruse. Once there, she is ambushed by a group of dark magic users. They might attack her using dark spells that she has a hard time defending against, and then, thinking she's dead, they leave her body there. This type of scenario can create a lot of tension and opportunities for other characters to find her and try to save her.
One possible plotline could be that Hermione was attacked by a group of dark wizards while on a solo mission. They might have been after some knowledge she possessed. After the attack, she could be found by a mysterious figure who nurses her back to health and together they seek revenge.
It could be Death Eaters who see Hermione as a threat to their new plans. Since she's very intelligent and has been involved in many battles against the dark side, they might target her to send a message to the Order of the Phoenix.
Harry and Ron are the most obvious choices. They've always been there for Hermione in the original series, so it would make sense for them to be the ones to find her and try to save her life. They would use their combined magical skills and knowledge to fight off any remaining threats and get her to safety.
In some 'naruto is attacked' fanfictions, he might be attacked by a new group of powerful villains who are not in the original series. For example, a secret organization that has been hiding in the shadows and finally decides to target Naruto because of his growing influence in the ninja world.
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 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.
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.
There are fanfictions where Hermione is attacked in a political context within the wizarding world. For instance, she might be targeted by those who oppose her Muggle - born rights activism. This can lead to a story of her fighting back against discrimination and bigotry while also dealing with the physical attacks. Some fanfics also explore her being attacked magically in a way that she has to use new and untested spells to defend herself.
One possible reason could be a misunderstanding. Maybe Hermione thought Snape was involved in some dark plot against her friends. In the wizarding world, there are often secrets and deceptions, and if she got some false information, it could lead her to take such drastic action.