What is the meaning of [Know on which side your bread is buttered]

To ‘know on which side your bread is buttered’ is to be aware of which side of a conflict it is in your interests to be on.

This proverbial saying is first found in John Heywood’s 1546 glossary A dialogue conteinyng the nomber in effect of all the prouerbes in the englishe tongue:

Thou farest to well (quoth he) but thou art so wood [crazy],
Thou knowst not who doth ye harm, who doth ye good
Yes yes (quoth she) for all those wyse words vttred,
I knowe on whiche syde my breade is buttred.