Why would a girl behave in this way?

In the beginning, we were texting almost every day. My crush was very interested in me, spending hours with me. We played games, laughed, shared secrets and more. When I confessed that I liked her, she said she felt the same way. Three weeks passed since that day and suddenly she said she didn't want to be my friend anymore. I was stunned, I discussed with her why, but got no reason - it seemed like she was trying to hide the real issue.

Another month went by, and yesterday, she unblocked me and texted saying that I was ugly, weird, and that she didn't feel anything for me. Said she doesn't find me attractive, but a bit obsessive. She talked to me because she had no one to talk to (she is very shy and has few friends), and when I confessed, she said she liked me just so she wouldn't hurt me - and the worst thing is that we continued texting and having me believe that she liked me until she completely broke up with me

I know I have to get over her, but it leaves a question: why? Why does a girl who used to care about me (yes, there was one day that I didn't answer her and she got worried), out of nowhere say these things to me? I confess that I was a bit needy with her - did she just want to get rid of me, so she said those things? Have you ever been through something like that?

If she has been lying to me all this time (two months), she has succeeded very well. I am even now trying to understand things.
Why would a girl behave in this way?
Add Opinion