Perhaps Hermione starts a secret club or organization for students who are interested in advanced magic. As Ron and Harry ignore her, she pours all her energy into this. The club gains popularity and starts to influence the way magic is taught at Hogwarts. Ron and Harry, seeing the positive changes Hermione is making without them, start to feel guilty and try to make amends.
Another way she could react is by distancing herself completely. She would stop trying to be part of their group and start creating her own identity at Hogwarts. She might explore parts of the castle she's never been to before, find new study nooks, and interact with students she's never really talked to, all while trying to forget about Ron and Harry's cold treatment.
It might be because of a misunderstanding. In some fanfics, a false rumor could spread about Harry. Ron and Hermione, believing it to be true, might decide to distance themselves from him. Say, there's a rumor that Harry is involved with dark magic in some way, and they, being the 'good guys', think they need to stay away.
One example could be a story where Ron and Hermione start a new project in Hogwarts that consumes all their time, so they accidentally start ignoring Harry. Maybe they are working on a new spell research and get so engrossed in it that they don't notice Harry's attempts to include them in his adventures.
It could be that Ron and Hermione abandon Harry due to a prophecy that they misinterpret. They believe that by being with Harry, they will bring doom to the wizarding world. So they go into hiding. Harry, on the other hand, is determined to change the course of the prophecy. He embarks on a journey to find the truth behind it, all while feeling the pain of his friends' desertion. He has to fight against dark forces that are taking advantage of the situation.
In such a fanfiction, it might be that Harry and Ron are influenced by a powerful dark spell. This spell makes them see Hermione as a threat, so they abandon her. Hermione then has to find a way to break the spell's influence on them while also dealing with the loneliness and danger she's now in. She could seek help from other Hogwarts students or even some friendly magical creatures.
Well, Harry might become very bitter. He could turn to other allies like Neville or Luna for support. He might also start to question all of his relationships and become more withdrawn.
A possible plot could be that the Muggle teacher is being targeted by a dark wizard who wants to use the teacher's knowledge of Muggle technology for evil purposes. Hermione, Ron, and Harry find out and decide to protect the teacher. They have to hide the teacher in the wizarding world and teach them basic self - defense spells.
One possible plot is that a magical object affects Harry and Ron's minds, making them bully Hermione. Hermione, at first, is heartbroken. But she then uses her intelligence to find a way to reverse the object's effect. Meanwhile, she also stands up to them, showing her strength. When the boys are back to normal, they are ashamed of their actions and have to make amends. This could also lead to a deeper exploration of the importance of true friendship and not being easily influenced by external factors.
In this kind of fanfiction, it could be that the author wants to explore a different dynamic. Hermione and Ron have a long - built relationship in the original series. Maybe the author feels that Ron and Hermione have a more 'grounded' connection compared to Harry and Hermione. It could also be about showing Ron's growth and how he becomes more worthy in Hermione's eyes over Harry.
In the world of fanfiction, this could be a very dark and interesting plot. It might be that Ron is influenced by some dark magic or some external force that makes him turn against his best friends. Maybe he's jealous of Harry's fame or feels overshadowed by Hermione's intelligence, leading to his betrayal.