One reason could be that Snape believes Hermione has knowledge that is dangerous if it falls into the wrong hands. So, he kidnaps her to keep her safe until he can figure out what to do with that knowledge. Another possibility is that he is being controlled by some dark magic or an outside force which compels him to take her against his will.
Hermione is also very confident in her knowledge. Snape is an expert in Potions, but Hermione is no slouch either. So, when Snape tries to undermine her in Potions class, she might respond with sarcasm. For example, if Snape corrects her in a way that she thinks is wrong, she could say 'Of course, Professor, your infinite wisdom must be right' in a sarcastic tone.
In fanfiction, sometimes authors like to break boundaries and explore 'what - if' scenarios. For the 'Snape cheats on Hermione' idea, it could be a way to create drama and conflict. They might be interested in exploring the emotional turmoil it would cause for Hermione, or how it could change the relationships within the wizarding world they've created in their story. It could also be a way to subvert the typical hero - heroine relationships we see in the original series.
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 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.
Some fanfiction writers might do it for shock value. They want to create a very different and extreme situation compared to the original story to attract readers' attention.
One possible reason is Snape's prejudice. He might have some sort of bias against Gryffindors in general, and Hermione, being a very Gryffindor - like student, gets the brunt of it. He may expect her to make mistakes typical of Gryffindors like being overly bold without thinking. Another factor could be that Hermione is so intelligent and inquisitive that Snape feels threatened. He likes to be in control of the knowledge in his classroom, and Hermione's constant questions and thirst for knowledge might make him act tough towards her.
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.
One possible reason could be for some sort of experiment. Gaster is often depicted as a mysterious scientist in the Undertale lore, and Sans has unique abilities. Maybe Gaster wants to study Sans' power over time and space. Another reason could be related to secrets. Sans might know something about Gaster's past or the true nature of the Underground that Gaster wants to keep hidden, so he kidnaps Sans to prevent him from revealing it.
In some fanfiction, it could be due to a prophecy. Percy might think that by kidnapping Annabeth, he is fulfilling a part of a prophecy that would ultimately lead to a greater good. He could be trying to keep her away from a certain situation or enemy that the prophecy foretold. However, his way of handling it, which is kidnapping, is a very extreme measure.
Well, sometimes authors want to create a shock factor. By having Snape take advantage of Hermione, it would be a very unexpected and controversial plot twist. Also, it could be due to a lack of understanding of the characters' personalities. Snape is a proud and somewhat noble character in his own way, and Hermione is not a weakling. So this idea might come from not fully grasping their essence.