Why would he put all this effort and then leave?

There's this guy that I've been friends with for like 3 years. He liked me once when I was with someone else, and I liked him at one point too, but he had lost feelings. Anyways that was a long time ago so it doesn't really matter but we do have history. So we've been just friends (not close though) since all of that and a couple weeks ago he started to text me a lot. His friends were extra friendly around me and would even talk to me about him. He started texting me nightly and we'd have long conversations about anything. He also started talking to me more in person, I could tell he had feelings for me. Then one night, everything was going great, and I decided to text first. Then it was done. He just ghosted me for a couple weeks. On my birthday we got back in contact but I stopped texting him until two days ago, when I felt like I should because we just had a test in one of our classes. He responded, went to bed, and has been ghosting me ever since.

My question is, why would he have put so much effort into me only a few weeks ago, and then completely switch up. Did he get a different girl? Or did he just never genuinely like me in the first place?

Why would he put all this effort and then leave?
Post Opinion