We are all influenced by the environment. How smart/beautiful/wealthy/successful yourself is relative. So is the confidence.
Have you ever felt less confident when hanging out with people who you think is much more successful/good about yourself?
Or otherwise, have you ever feel conceited (full of yourself) because it feels stronger than the ones you think is lower than yourself.