In which way is it similar? Dementia comes with a specific set of issues that preclude progress, it's a degenerative disease.
The depressed mind can convince itself that anything you say feeds into the depression. Everything becomes a spiraling self-reinforcing belief that "nothing can help, nothing can fix it". Like dementia, there are physical processes causing depression. Some people have it so severely that they lack energy to move out of bed or accomplish basic tasks even though they "know they should want to", so like dementia, which causes further spiraling. Being sad, sad thoughts occurring in ones mind, having no energy to move and enjoy life, they contribute to the depression. Like dementia, it can end ones life due to bad interactions with the environment, and the slow downward spiral.
A similar "degenerate mental disorder" can be observed in the hyper-rationalist death cults where every bit of evidence seems to confirm some kind of oddly over-simplified and anti-human world-view. They eventually become beyond reason or sense-making (despite a growing belief of certainty and "grounding in reason"), until the process becomes "self terminating". Any evidence simply becomes more reason to believe what they are already thinking (so its kind of degenerative), and of course will arise based on various physical and environmental factors.
For depression you can tell people you love them and you care and they cannot believe it.
For dementia you can tell your mom you love her care a lot and she cannot hold that thought.
It's similar in that your rational words and even actions don't matter.