And this is the big issue : no one learn has told you, neither taught you how to play it. But some people were. Those are fine.
For the others (me included) we had to figure out on our own. Learn that we played the game the wrong way, or find another place. It took time, and a lot of investment and efforts are wasted in the process. And some people never learn. Meanwhile, those people stole undeserved credit. And if you ask them, they will tell you its thanks to their leadership and all that bullshit.
Actually, the most important thing you said is that : life is not fair. 100% fully agree.
No, it's not fine at all ... it happens, but it's not fine. Just as getting good at stealing is not fine.
Don't get slowed down by dishonest, non-cooperating types unless you have a lot of people supporting. There is more of them than you alone and they will drag you in their own territory and defeat you with their experience.
I have a deep lack of respect and huge hatred for these types of ass holes. If I became this type of person I would hate myself.
However, you are right in the fact that many people are like this exist and life is not fair. My hatred is just a personal preference. I can see a lot of people answering your question with a yes... which says a lot about people in general. Most people are ass holes and that's life.
Whilst I tend to agree with this "between the lines" as it were, it's not an attitude I can healthily recommend. Re-shape it to "most people are trying to get ahead and that's life" is a much more helpful way of looking at various situations, and makes human behavior much easier to understand and predict.
You may also find that it reflects back on you some.
The truth is that life is not fair.
You and your manager were playing a different game. While you were spending your time and resources trying to do good for your company and to get better at doing that, your manager was spending time scheming in his own interest and also getting better at it.
He beat you with experience. You were spending your time in Jira and IDE while he was building up his own image, perfecting ways to shift blame and building connections.
And you know what? It is fine. Just ask yourself, "would I want to be that person?"