The Cake

 was originally a sponge cake that Romana II bought on Barastabon for K9's birthday. However, a trip in the TARDIS and, according to the Fourth Doctor, the "unique atmospheric conditions" of a planet made of sweets had turned it sentient. It politely asked them not to eat it. They decided that it should live on the planet of sweets. (PROSE: Special Occasions: 1. The Not-So-Sinister Sponge)