He was her friend in childhood but this doesn't make it obvious that she had to fall in love with him. That's why I'm always so amused when people make all this deep research to understand why Lily chose Snape when in fact there was no choice at all. She just had Severus as a friend and fell in love with James - she didn't choose between them because she never thought about Snape as a romantic possibility. Also, in my opinion, it's just absurd when people say that "oh, she loved him, but when he called her mudblood she just stopped and went for James" First of all, if she did love Snape, that wouldn't be enough for her to stop, secondly, according to her behaviour after the incident, she was disappointed in Snape as in friend - there was no love there. Snape continued to be angry, gloomy, passive and interested in dark arts. He never cared to express his love for Lily, never cared to change to match her, to make at least some effort - from his point of view she should have stayed with him just because he wanted it, it's insincere and unfair. Moreover, Lily obviously understood Snape's advances and never acted upon them - never supported his claims - this is called friendzone, guys. Lily never loved Severus and never would've loved him and he loved the idea to love her.