It's good to offer condolences.
Joe is at a funeral for a friend and the friend's parents are there.
Joe wants to talk to the parents of the deseased.
Joe talks to the parents and tries to make them happy, by offering his condolences.
Joe talks about the weather with the parents but does not offer his condolences.
The parents are glad Joe did that, and they all have a better day.
The parents remain sad and Joe wonders if he approached this wrong.