We like it when we agree with our friends’ opinions, especially when it comes to how we feel about particular other people. This is the source of the expressions “My friend’s friend is my friend; my friend’s enemy is my enemy.” On the other hand, sometimes we like a person whom we later discover is disliked by one or more of our friends. And sometimes we dislike someone that a close friend turns out to like very much. Such realizations create in us a certain sense of discomfort, and when possible, we’ll probably do what we can to change this situation. Balance theory, an early theory from social psychology, can apply to such situations of "imbalance" and predict how balance will be restored.
Reference: Heider, Fritz (1958). The Psychology of Interpersonal Relations. John Wiley & Sons.
Heider, F. (1946). Attitudes and cognitive organization. Journal of Psychology, 21, 107-112.