Social psychology has a whole branch of study devoted to "attribution theory." It begins with the way we attribute our own actions and choices to the moment we were in, but we attribute other peoples actions to their personality traits. And yes, we make exceptions for the folks we like.
I used to get offended by things lots of people said to me, because those statements could be interpreted as questioning my competence, intelligence, or good intentions. Now I hardly ever get offended, because I know most people are too busy with their own lives to be trying to make mine more difficult.