Self-serving bias
A self-serving bias is a confirmation bias based around the ego. It occurs when we interpret the world in a way that is positive to our existing sense of self. This is not necessarily a bad thing, but it sometimes is.
This leads individuals to attributing positive events and successes to their own character and conversely, attribute negative events and failures to external factors beyond their control (See Figure 1).
Practical examples
Self-serving bias is exhibited at work in such examples as to when someone says they were hired for a position because of personal factors, like their exceptional resume or other sterling qualities. But if they don’t get the job, then it’s because of some external factor besides their own shortcomings, like an incompetent organization or a short-sighted hiring manager. In the eyes of someone suffering from self-serving bias, it’s never their fault.
It's often due to the ego, self aggrandising or conversely, avoiding the cognitive dissonance of failure.