Why do guys give a compliment and then say something to contradict it later?

For example, one day they’ll say “oh you look beautiful in this hat”, then another day they’ll say “is that what you’re wearing?”
Why do guys give a compliment and then say something to contradict it later?
Post Opinion