Men want what they can’t have

WHYYYY is it that when you don’t show a man attention he comes to you. But when you show that you want some attention or give him constant attention he is the opposite ?