Why does this happen?

So this has happened twice so far, I talk to guys and we are clicking right off the back. The first guy was up front about it and said he was not ready for a relationship and I was cool with that, but once he saw me in public it was like he wanted me and jealous if I was to talk to another guy. Then the second guy and I were talking for a good month, I was sure he liked me but guess what he stopped texting me. I now see him at parties and he does the same thing. He makes sure people are seeing me talk to him or flirts all the time. Like why flirt or be jealous if you didn't want to be with me?
Why does this happen?
Add Opinion