We do things in our lives because we get a benefit from it. No matter how horrible it may seem we will still get a benefit from it.
If we perceive that the benefit that we are getting outweighs the benefits that we will get if we stop doing whatever we are doing, then we will not stop. A person may suffer from depression but in doing so that person gets benefits. The benefits may that they do not have to go out and work, the family runs around for them etc,etc.
If that person perceives that the benefits that they are getting outweighs getting better, then they will not move out of their depression. This is often not a conscious decision and it is often only when this has been pointed out that the person realises what has been happening.
It is often prudent to ask a person who has had long term depression, anxiety, stress or PTSD what the downside would be if they get better. By them being able to see that there is a downside it enables them to have a more balanced approach to recovery.