To provide some context as an example: Let's say that a sports team you're a big fan of, someone famous you idolize, or just YOU alone, was in some game or competition or otherwise in any sort of big situation and that's say that you pretty much lost or didn't win or succeed at something and at first, the upsetting results feels like such a downer and a travesty for you. But then you took a nice look at yourself and then compare yourself to other people and then you say to yourself that "It's all in good company"
What does the expression mean to be precise?