This saying means to suck up to someone in order to cajole and manipulate them.
It is thought that butter is used because it will grease someone up and make them pliable.
Also, ancient Indians used to throw balls of butter at statues to win the favor of the gods.