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.
However, as the story progresses, Harry might start to understand Snape's motives. He could realize that there's more to Snape's actions than just pure meanness. This realization might make him more accepting of the punishments, or at least more willing to try and figure out what Snape is really up to.
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.
Harry could try to talk to Dumbledore about it. Dumbledore has a lot of influence and might be able to make Snape see the error of his ways.
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.
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.
At first, Harry would be confused. He has always seen Snape as a complex figure, and the idea of being rejected as a son would be a shock. He might start to question his own self - worth, thinking that if Snape doesn't want him, there must be something wrong with him. As time passes, he could grow bitter towards Snape, but also use this as motivation to become stronger. He might focus on his friends and the positive relationships in his life, trying to move on from Snape's rejection while still carrying the pain deep inside.
Snape could be initially shocked. He's used to seeing Harry as a rather tough and rebellious student. So, seeing Harry cry might take him aback for a moment. Then he might become a bit more guarded and try to figure out if Harry is faking it or not.
Snape could initially be skeptical. Given their long - standing enmity, he might not believe that Harry's apology is sincere at first. He might respond with a cold glare or a sarcastic comment, like 'Potter, your apologies are as empty as your head.'
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.
Snape might endure the punishment in stoic silence. He is a complex character and often used to hiding his true emotions. So, he could just grit his teeth and bear it, all the while plotting his revenge or a way to get out of the situation.
Harry might be angry at first. He could feel that Snape is being unfair and overstepping his bounds. So, he might storm off and sulk in his room, refusing to talk to anyone.