It's said that you can not be grateful and unhappy at the same time. (Sort of like you can't pat the top of your head at the same time you rub your belly in a circle.) I think it's true, we just aren't wired to be grateful and unhappy at the same time. So, searching for and expressing gratitude is a way to avoid unhappiness. If I could only remember this when I need it.