I once read a definition of the idiom “Misery loves company” as “Unhappy people like other people to be unhappy too”. I disagree with this interpretation entirely. The first time I heard this I was probably 8 years old, and my understanding then is the same as it is now. When one is in pain or misery, one wants to be around others experiencing similar pain in order to gain strength collectively to overcome it (granted, my 8 year old interpretation was a little simpler, but I got the gist).
This is why group therapy is so successful. Being around others who are experiencing suffering brings comfort that we are not alone, and evokes understanding of the suffering in ourselves.
Conversely, it is a natural human reaction to turn away from those that are suffering as a survival mechanism. “No one wants you around when you’re down” is another idiom that I have experienced personally. It’s like you are contagious and the instinctual move is avoidance. Then there are the truly compassionate who resist the temptation to turn away, recognize it you are suffering, and offer to help.
A friend in need is a friend indeed.