What's up with certain girls who pull away when you start being nice to them. But then when you give up and ignore them they turn all affectionate and lovey. What is going on in their head? How do I make sense of this?

I'm just not really sure what they are thinking ir what the correct play there is. None of it makes sense to me. I was hoping someone could share their insight into this and allow me to benefit from their experience or knowledge