One possible reason could be that Snape has shown unexpected kindness to Hermione in the fanfiction. Maybe he has protected her from some danger secretly, which makes her feel she can rely on him and thus feel safe.
Perhaps in this fanfiction, Snape has a deep understanding of Hermione's intellectual side. He respects her intelligence and knowledge, and Hermione, being someone who values such things, feels safe in his presence as she doesn't have to constantly prove herself. Also, Snape might have a reputation for being extremely powerful in the magical world depicted in the fanfiction, and Hermione knows that with him around, she is shielded from a lot of threats.
One reason could be the re - imagining of Snape's character. In fanfiction, he might be kinder and more understanding towards Hermione than in the original story. So, she feels safe in his presence.
Perhaps it's because Snape is a complex character in the original story. Fanfictions might explore his character in ways that make Hermione seem protected in those fictional scenarios. For example, some fanfictions could depict Snape using his knowledge and power to shield Hermione from various threats within the magical world they inhabit.
One reason could be Snape's knowledge. Hermione, being a knowledge - seeker herself, might feel safe knowing that Snape has a vast understanding of magic, especially the darker aspects. So, she believes he can keep her safe from any threats related to that knowledge.
Well, it could be that the fanfiction author has created a unique backstory. For example, Snape could have saved Hermione's life at some point in the past, and she now has this deep - seated sense of security around him. Also, he might be a source of knowledge for her, and his presence, while initially intimidating, becomes reassuring as she realizes he won't let harm come to her in matters related to magic and the school.
One reason could be that in this fanfiction, Snape has some hidden kindness towards Harry that he doesn't show in the original story. Maybe he secretly protects Harry from other threats, which makes Harry feel safe around him.
Often, it starts with a shared experience. For example, they might face a dangerous magical creature together. After that, Snape might show concern for Hermione's well - being, which begins to build her sense of safety around him.
One scenario could be that Snape saves Hermione from a Dark Arts spell gone wrong. As he catches her in his arms after deflecting the spell, she feels safe because he has just rescued her life.
Fanfiction allows for a lot of creativity. Perhaps the story is set in an alternate universe where Snape and Hermione have a different dynamic. Snape could have redeemed himself much earlier in this universe, and Hermione has come to understand his true nature. So when he holds her, she feels safe because she knows he is on her side, that he has changed from the cold and strict professor she knew in the original story.
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.
One possibility is that the fanfic changes Snape's backstory to make him more sympathetic. Harry, being empathetic, then feels safe around him. For instance, if Snape's past is shown to be full of hardships that made him act the way he did, Harry might understand and feel safer in his presence.