His parents might have placed protective spells on Harry before they died. In the fanfic, these spells could be triggered in a way that helps Harry escape. For example, if the Dursleys try to harm Harry, the spell could make Harry invisible and then lead him out of the house. It could also be a spell that summons a friendly wizard or witch who then takes Harry away from the Dursleys.
One way could be that they appear as ghosts or apparitions. Their presence alone might be enough to spook the Dursleys into releasing Harry. The Dursleys are very much afraid of the supernatural, and seeing Harry's dead parents would surely be a terrifying experience for them.
In some fanfictions, Harry's parents could have made a deal with some powerful magical entities. As part of the deal, these entities would keep an eye on Harry. When the situation at the Dursleys' becomes unbearable for Harry, these entities step in. They could use their magic to make the Dursleys forget about Harry or simply teleport Harry to a better place, like a wizarding community where he can be safe and cared for.
In certain fanfic scenarios, Harry's parents may have left behind some enchanted objects. These objects could have special powers. When Harry discovers them, they might activate and create a magical portal or something similar that allows him to leave the Dursleys' place. For instance, a locket that when opened, transports Harry to a safe place where his parents' magic has created a haven for him.
Another reason could be that they had some sort of premonition or prophecy that indicated the Dursleys' place was a crucial part of Harry's future protection. Maybe a seer told them that for Harry to grow into the wizard he needs to be, he has to endure the Dursley experience first.
One way could be through the intervention of a powerful wizard or witch who discovers Harry's mistreatment. For example, Dumbledore could send someone like Sirius Black earlier to rescue Harry. Another way might be if Harry himself discovers his magic earlier and uses it to escape. Maybe he finds a magical object in the Dursleys' house that helps him get away from their cruelty.
Perhaps he realizes that Harry has potential that can be used for his own purposes rather than just killing him. So he wants to keep Harry close and away from the Dursleys who are just muggles.
It could be out of loyalty to the wizarding world. Harry is seen as an important figure in the fight against the dark forces. Fleur realizes that Harry's safety is crucial for the future of the wizarding community, so she saves him from the Dursleys who are a threat to his well - being in a different way compared to the dark wizards.
In some versions of the fanfic, Harry might have a sort of instinctive understanding that his parents had a good reason for leaving him there. So, while he's still not happy about it, he might be a bit more accepting. Maybe he can sense some sort of protection spell around the Dursleys' house that gives him a small sense of security.
Harry would likely be more well - adjusted. He wouldn't have the emotional scars from being mistreated. He might be more trusting of adults, as the Dursleys, in this scenario, would have been kind. This could lead to different relationships at Hogwarts, perhaps being more open with teachers like Snape from the start, which could change the whole Snape - Harry dynamic in the story.
Love for Lily. Since Harry is Lily's son, Snape might feel an obligation to protect him. He couldn't save Lily, but he can try to keep her son safe.
Well, it could be that Draco has a change of heart early on. He realizes that the Dursleys are truly awful to Harry. So he uses magic to create distractions. He could make strange things happen around the house that scare the Dursleys so much that they just want Harry to leave. Then Draco could be waiting outside and whisk Harry away to a safer place, like a hidden place in the wizarding world where he has set up a little haven for Harry.
There are many ways it could be written in fanfiction. Ginny might use her knowledge of the wizarding world and Hogwarts' secrets. She could use a special spell that she learned from an old book in the Hogwarts library. This spell could create a portal right inside the Dursleys' living room that only Harry can see. Ginny could then communicate with Harry through a magical device, tell him about the portal, and he can use it to escape from the Dursleys. Ginny would have to be very careful and plan everything precisely to avoid detection by the Ministry of Magic, as using magic around Muggles without permission is strictly prohibited.