Because, in my opinion, they don't. How can they? It's particularly annoying when they say it, followed by an anecdote of their own which bears little relevance to the predicament you yourself are in.
I do realise that most people are trying to be nice and sympathetic when they say this. But it still winds me up.