Perhaps in the fanfiction, James is seen as more accepting of Lily's friends and her social circle. Snape, on the other hand, might be associated with a darker crowd or have some beliefs that Lily doesn't agree with. For example, if Snape is too involved with the Dark Arts in the fanfiction, it could be a turn - off for Lily.
In many fanfictions, James is often written as having a more positive family background. His family could be portrayed as warm and loving, while Snape might come from a more troubled family. Lily might see a future with James as being more stable and happy, with a family that she could be a part of without much drama or hardship.
One reason could be jealousy. Snape might be jealous of James' popularity and charm. James, on the other hand, could be jealous of Snape's close friendship with Lily in their early years. Another reason is their different personalities. James was outgoing and bold, while Snape was more introverted and brooding. Lily might be attracted to different aspects of each of them, which could lead to the fight as they both compete for her attention.
One reason could be jealousy. Maybe Snape gets jealous of Lily's other relationships or her popularity at Hogwarts. Another could be a fundamental difference in their beliefs or values that grows over time into hatred.
One reason could be jealousy. If in the fanfiction Snape is getting more attention or praise from the wizarding world than Lily, she might start to dislike him. Another reason could be that Snape has a different view on blood purity, and Lily strongly disagrees with him, which leads to her hatred.
It could be that in fanfiction, Snape has been through some additional trauma or experiences that change his perception of Lily. For instance, if he discovers something about Lily that he doesn't like, such as her involvement in some secret or her having a different side to her character that he finds unappealing. This would cause him to dislike her, as opposed to his more nuanced feelings in the original story.
In some fanfictions, it could be related to Lily. If James did something that Snape perceived as a threat to his relationship with Lily, even if it was just being overly affectionate with her in front of Snape, Snape might lash out at James. Snape had deep feelings for Lily, and any sign of James getting in the way could trigger an attack.
Perhaps Snape believes that James has some crucial information that he needs and he thinks torture is the quickest way to get it. Or maybe there's a power struggle going on. Snape wants to assert his dominance over James, who might be seen as a rival in some way, either for a position at Hogwarts or in the wizarding community. Also, it could be due to a misunderstanding that has spiraled out of control, leading Snape to think that James is a greater threat than he actually is.
Lily. Since Snape and Lily were friends when they were young, and James had a crush on Lily. Snape might have had a special connection with Lily that James desired, so he could be jealous. Also, Snape was always kind of an enigma, and that mystery around him might have made James jealous as well. He might have thought Snape had some sort of power or charm that he didn't.
In this type of fanfiction, a plot twist could be that Snape saves them, but they end up having to go into hiding in a completely unexpected place. Maybe they have to live among muggles in a way they never thought possible. Another plot twist could be that Snape saves them, but then realizes that he has put himself in a very dangerous position with Voldemort's followers. So he has to find a way to protect himself while also protecting Lily and James. And there could also be a plot twist where Snape saves them, but they don't believe his motives are pure and they try to escape from him, leading to a whole new set of adventures and challenges.
It could also be due to some external factors. Maybe there are threats from dark forces that he doesn't want to involve Lily in. If he is getting deeper into the dark arts or some dangerous situations, he might choose to give up on her to protect her from the potential harm that could come her way because of his associations.
If Lily chose Snape, it might have prevented some of the tragedies. Snape's loyalty could have shifted earlier, and there could have been more harmony among the magical factions.