I mean, that adage about hard times, while entertaining, has zero truth to it. It's not something supported by history. It just sounds cool to say is all.
I disagree. I think the reason combat veterans often feel like their squad is a second family and rich country club members often feel like the other members are competitors is the difference in the adversity of each situation.
However, I think the type of “bad times” conducive to building strength is fairly particular; it only creates strong people if the problems being faced are external and require cooperation to solve, and the people facing adversity are capable of overcoming their own problems when adversity forces them to face them.
If interpersonal problems are the main source of adversity, and there is nothing external to force cooperation, that’s often demoralizing and more conducive to antagonistic forms of competition rather than camaraderie and self improvement.
Arguably, "hard times" are pretty much defined by serious external or environmental problems threatening normal life, and only in good times you're left with interpersonal problems as the main source of adversity.