In some fanfictions, Snape might punish Harry by giving him extra detention tasks like scrubbing the cauldrons in the Potions classroom until they shine. This is a common form of punishment as it's within Snape's domain as the Potions master.
Another reason might be that Harry is suspected of sneaking around in areas where he's not supposed to be. Snape, as a vigilant teacher, may punish Harry to maintain discipline in the school. He may think Harry is up to something related to the ongoing dangerous situations in the wizarding world and wants to keep him in line.
In some fanfics, Snape might punish Harry because of his perceived insolence in class. Harry has a rebellious streak, and Snape, being strict, wouldn't tolerate any behavior that he deems disrespectful to his authority as a teacher.
However, as the story progresses, Harry may start to understand the reasons behind Snape's actions. He could become more resigned and accept the punishment as a part of his growth. He might use the experience to become more cautious in his actions and more respectful of the rules.
It's popular because many fans prefer to explore the complex relationship between Snape and Harry in a more traditional, platonic way. Their relationship in the original books has so many layers, like Snape's hidden protection of Harry and Harry's gradual understanding of Snape's true nature. Fans want to delve deeper into these aspects without adding romantic or sexual elements.
At first, Harry is likely to be angry. He might feel that Snape is being unfair and targeting him. Harry has a strong sense of justice, and when he believes he's being wrongly punished, he'll be resentful.
In many Snape and Harry slash fanfictions, Harry often becomes more understanding of Snape's past and his motives. He starts to see beyond the grumpy exterior. Snape, on the other hand, may become more vulnerable and open. For example, in some stories, Harry's kindness breaks down Snape's walls.
Fanfiction websites like Archive of Our Own (AO3) are great places to start. There's a large collection of fan - created works there, including Snape - related fanfiction. You can use the search function to specifically look for 'Harry' and 'Snape' in a slash context.
One common theme is redemption. Snape is often seen as a character in need of redemption in the eyes of Harry, and this theme is explored in many fanfictions. For example, Harry might be the one to finally see Snape's true self and help him find peace.