In some fanfictions, it might be due to a prophecy or some magical bond. For instance, there could be a prophecy that Draco's life is intertwined with Harry's in a way that if Draco dies, something bad will happen to Harry or the wizarding world. So Harry takes on this overprotective role to ensure Draco's safety. It also adds an interesting layer to their relationship, changing it from the typical rivalry in the original books.
One popular one might be 'A Different Kind of Bond' where Harry's overprotective nature towards Draco leads to some really interesting character development. It shows how their relationship changes from being rivals to something more like family.
In some fanfictions, Harry might be overprotective of Hermione because of their strong friendship. They've been through so many dangerous situations together in the original story. Harry values Hermione deeply and has seen how vulnerable she can be at times, so he feels the need to protect her.
In fanfiction, Harry might slap Draco because of Draco's constant taunting. Draco is often portrayed as a bully, and there could be a point where Harry just can't take it anymore.
Maybe it was an accident. Like a wrong Floo Powder destination or some kind of misfired spell that landed Draco right at the Dursleys' doorstep just as Harry was there.
They might go to the Burrow to reconcile. Fanfiction often explores the idea of enemies becoming friends. The Burrow, being a place full of warmth and family, could be a good setting for them to start over. It's a place where they can put aside their differences and get to know each other better without the pressure of Hogwarts politics.
Well, for some it might be a form of shock value. They want to create a story that stands out from the more common, positive portrayals of the characters. Others may be exploring the 'what - if' scenarios in a very extreme way. What if Draco, who was on the wrong side in the books for a while, really let his dark side out on Harry? It gives them a chance to delve deep into the possible psychological states of the characters, but again, it's not something that everyone would be comfortable reading or writing about.
Draco could be acting on orders from someone else. For example, if a more powerful dark wizard or a Slytherin senior told him to do it as part of a scheme to disrupt Harry's focus and make him more vulnerable to attacks, either physical or mental.
Maybe Draco finally understands that Harry is a victim of circumstances. The Dursleys' treatment of Harry is cruel, and Draco, having grown up in the wizarding world, realizes it's wrong. So he steps in to rescue Harry.
Well, it could be due to Ginny's past experiences too. She was possessed by Voldemort when she was younger. Harry knows how terrifying that was and doesn't want her to go through any more trauma. So, in fanfic scenarios, this makes him overly protective, always hovering around to make sure she's okay and not in any danger.
One reason could be the complex relationship they have in the original series. Fanfic authors often expand on that. Maybe Draco realizes Harry's importance in the fight against the real evil, like Voldemort, and so he becomes protective. It also adds an interesting dynamic to the story, making it more appealing to readers who love exploring different character relationships.