Like any other animal: swallowing food and directing it to the stomach for digestion. But the process is not so simple.
In the best case, the bicephaly is caused by the abnormal bifurcation, during the development of the embryo, of the vertebral column. What is a normal body up to the neck, at the height of the digestive tract is divided into two. The animal only has to worry about ingesting the food: the only stomach of the body can feed both heads.
Brains in competition. The only drawback is the eventual competition: having two heads also means having two brains, and the cases in which the two ends are made … ruthless competition are not rare.
It is worse for the animals in which the anomaly is deeper, and in addition to the two heads also the other internal organs are double: in this case, each head must worry about nourishing its own stomach, and the competition can also lead to autocannibalismo.
This is why two-headed animals tend to have a shorter life than "normal" animals. With a few exceptions: the San Diego Zoo (USA) has for years hosted Thelma and Louise, a two-headed specimen of an obsolete Elaphe snake. In twenty years, the animal has also had 15 healthy children.