Growing up and becoming (something of) an adult, the one thing that still constantly surprises me is the huge amount of mediocrity surrounding me, and not just that: they're succesful and happy. Part of the reason for this surprise is that I generally surround myself with people that are at the very least not much more mediocre than me, and often people that are on par or 'better' than me.
If you're a PhD student, you're clearly not 'mediocre' by most standards. And I suspect you're in a competitive environment full of people that are either very smart, or trying to prove they are.
So then ask yourself: who am I comparing myself to, and why is it important to do so. There's always someone 'better', so thinking in this way is futile.
My general approach to life is this: if I feel like the smartest person I know, I should find more smarter friends. If I feel intimidated or bad by those around me, I should perhaps find friends that are equal or less smart then me. I've been in both situations.
Incidentally, many of those I thought smarter than me really weren't. And those of my friends that are 'dumber' then me make up with that in a myriad of other ways, since fortunately being smart isn't all there is.