Why do guys stop talking to you after you reject them?

Had a guy friend I knew since 9th grade, met him through a mutual friend. I thought he liked my friend. Few years later everyone's telling me he liked me. He finally got the courage to ask me out, in which I said no. He slowly stopped talking to me after he was acting like everything was ok. Another guy asked me out about two months into me starting high school, I told him no and he considers me his best friend now. The other guy recently tagged me in a memory on social media about me and him and I commented but he never said anything. Before we were kind of flirty but I thought he was joking, I was, me and my guy friends would do that sometimes so I thought nothing of it.
Why do guys stop talking to you after you reject them?
Post Opinion