Usually its meant to condescend and to get you to stop talking to them about your problems
Not always, and when it is, it’s obvious. I’ve never had that happen, personally.
I can’t say it never happens, but I generally know the people well enough that I mention it to, that they know my heart on the issue.