This phrase is used to indicate someone acts favorably towards those who can benefit them. She praised her colleague's proposal, knowing which side her bread was buttered.
Pro Tip 2/3
Situational Awareness
It's important to recognize the context where someone could have something to gain. At the company banquet, he knew which side his bread was buttered and stayed close to the executives.
Pro Tip 3/3
Not Genuine
The phrase may imply that the person's actions or flattery aren't entirely sincere. He complimented the chef, knowing which side his bread was buttered, although he disliked the meal.