Your knowledge, commitment and competence are worth less than you think, much less than being liked.
A competent person who can deliver more than expected, consistently, within deadlines, but who keeps to himself, will always fall behind someone who does the bare minimum (sometimes not even that) but makes people laugh, who talks to the boss about mundane things, and who is a reference for being nice to be around, more than for his knowledge – and that’s even if the high-performing person isn’t an asshole, but a decent, helpful and cordial human being. Having knowledge is often a bonus, not a requirement, even if HR people don’t admit it.
Corollary: what counts in the workplace is social status, how people can gain that status, and how you can serve to increase or reduce the status of others. The work to be done is most of the time just a proxy, a way of playing with social status to value yourself or your boss. A higher position, with a higher salary, symbolizes a higher social status. Being recognized or liked by people with a higher position work as well. You do the same whether you want to or not. Accept this and decide if you want to play the game.
Corollary of the Corollary: Don’t take your job too seriously. Do it right, do it on time, but always focus on what’s important to you, because no one else will care about that – not you, nor your health. If what’s important to you in life coincides with work, great. If not, find a way to live with both.
Random thought: this is why work-from-home is so frowned upon by companies, it kills that social status dynamic and makes performance more important than relationships between colleagues. Without the tools to play with status, competence becomes more apparent and many people don’t want that.