performance vs potential
You judge job qualification based on your performance. Your boss promoted the other person, most likely, based on potential.
Either you close the gap, or find job somewhere else because perception is set and hard to change.