There is an extremely straightforward theory as to why we say this, namely that the phrase refers to smoothly buttering a piece of bread to make it tastier. A more likely (and interesting) explanation, however, comes from the Hindu temples of India.
In order to seek divine favour, Hindu worshippers would throw balls of ghee –clarified butter used as the foundation of Indian cooking – at statues of their deities. By ‘buttering up’ the gods, it was hoped that the worshippers would be rewarded with peace and good harvests.
When this began is unknown but the guides of the Meenakshi Amman Temple in Madurai, Tamil Nadu, built c1600s BC, speak of the ancient custom.
A similar principle can be seen in the Tibetan New Year celebrations, where sculptures made out of coloured butter would be displayed as gifts to the heavens. This practice can be traced back to the Tang Dynasty (AD 618-907).