This has been going on for ages and we even see references to one person taking away all the credit of another person's work even in the great epics. The question is - what will you do when it happens with you? Now, isn't this the question that everybody hates to even think about while there would be many who are actually scared of such a thought to cross their minds?
That's because the underlying reasons for such a thing happening will mean that the person evaluating your work is biased against you and doesn't want you to get the credit that is due to you. That person is powerful and is also crucial for your progress but you haven't been able to impress him. He could even conspire to get you sacked or get you demoted.
Workplaces are actually the hub of conspiracies since all kinds of people are found there. Given the human tendency of overpowering greed for money and power, people go to unimaginable lengths to get their way and it matters little whether they get it by hook or crook. So if you're expecting to find a workplace full of cooperative and understanding colleagues, you're going to be disappointed. Yes, there will be some cooperation and understanding by some folks but only up to a point and no more. Like most other aspects of human relations, office relations also are not one-way traffic.
You have to be smart and alert enough to work your way around. That's a basic skill you should have irrespective of how good your educational career has been. You may have earned your degree from the best of institutions but that's not going to get you past a wily and scheming colleague who is hellbent on getting ahead of you.
Alternately, you may come across a boss who is paranoid about your capabilities which he feels, he can't match. Such a person is most likely to create problems for you by ignoring your performance or even reviewing it negatively. He will even try and humiliate you in front of your colleagues who are in competition with you and will present you negatively to them by lying about you.
We, humans, have both good and bad in us and the sooner you accept that, the better you'll be able to tackle such ugly situations. Don't make the mistake of thinking that you're the epitome of truth, honesty, and integrity; nobody is.
It's just that the good in some people is more while in others, the bad is more. Being able to appreciate this truth will help you to recognize the bad guys fast and without being shocked - 'oh my God, I never imagined this person to be like this!' Howsoever, friendly people may be toward you, it would be a mistake to take anybody lightly.