When someone is severely depressed, they aren't thinking rationally. They don't see the people around them as people they can confide in. They may feel that they have messed up their lives to the point that everyone would be better off without them.
In their minds they are doing the selfless thing, by taking themselves out of the picture. No, they don't think about the lives they leave behind, because either they don't think those people care about them or that they will be better off with them gone.