It is known as "social comparison".
Social comparison theory expresses that we decide our own particular social and individual worth in light of how we stack up against others. Therefore, we are continually making self and different assessments over an assortment of spaces, for instance, engaging quality, riches, knowledge, and achievement. These comparisons are capable in forming a person's personality, inspiration to enhance themselves, confidence and general fulfillment with their life.