Often, the development is complex. Fanfic writers might explore Snape's guilt over Lily's death as a driving force. Since Harry is Lily's son, Snape might feel an obligation to protect him. In some stories, this obligation turns into genuine affection. They could go on adventures together, where Snape shows his care for Harry in a more hands - on way, like making sure he has enough food and rest during their travels. As time passes, Harry also starts to look up to Snape as a father figure, seeing his wisdom and the sacrifices he has made.
In many fanfictions, their relationship develops gradually. Snape, who initially seems to hate Harry due to his resemblance to James, slowly realizes his own fatherly feelings. For example, in some stories, Snape starts to protect Harry secretly from the shadows. He might use his knowledge of potions to brew antidotes when Harry is poisoned. This new - found relationship often stems from a deeper understanding of each other's past traumas.