It started when they were pretty much toddlers. Billy WOULD NOT leave her alone. Despite her efforts, she inevitably found it easier to just tolerate his presence. He has basically become a fixture in her life. The same has pretty much happened to Grim, only Billy and Mandy are the ones that won't leave him alone.
Basically, it's milquetoast Stockholm syndrome all around. Well, except for Billy, he's too stupid to realize nobody actually likes him.