The best explanation in regards to why my boss, and everyone here's boss, is a jerk:
They attribute your failures to flaws and their own failures to circumstance or whatever life context they're in. So if they're tired or had a bad night at home, they know why they started yelling.
So basically it's basic solipsism or narcissism. They don't empathize with other people failures or mistakes and don't accept excuses for anyone but themselves.
Among the list of "improvements" that I would choose for the human cognitive architecture, very high up would be a little extra test before any thought is committed to belief or sentence is uttered aloud. Just a little addition to the mental flowchart... "is this thought a result of the fundamental attribution error? If no, proceed. If yes, rethink." [1]
We really, really need our stories and myths to teach this out of us more as children. Maybe a little rhyme or something.
[1] "actor-observer bias" to be more accurate and general, but I like the inclusion of the term "error".
We should probably also explain our existing child hood stories a little better. For example, when I heard "the boy who cried wolf" it was basically explained as "don't waste people's time". When I tell it to my kids I use it to explain credibility and how people react to it, and as an example of a logical fallacy (just because the boy was a liar doesn't mean what he says is always a lie).
They attribute your failures to flaws and their own failures to circumstance or whatever life context they're in. So if they're tired or had a bad night at home, they know why they started yelling.
So basically it's basic solipsism or narcissism. They don't empathize with other people failures or mistakes and don't accept excuses for anyone but themselves.
The preceding was an anecdote.