Cathal was king of Munster, and Fergal was king of Ulster, with an intense rivalry between them as both wanted to be high king. Fergal's sister, Leah, fell in love with Cathal and sent him delicacies. Fergal summoned his wizard and ordered him to perform his mystical practices so that whoever eats them will never again have a day's health for the rest of his life.
When the apples entered Cathal's stomach, they turned into worms, but one large worm consumed all the others. From then on, Cathal was constantly ravenously hungry, and he ate the food belonging to everyone in his palace and in the areas he travelled through.
Ronan, a medical student, eventually realized the monster could be evicted by the same way he had entered it, by fasting and appealing to the power of the church. Ronan convinced the king to fast and give him apples based on religious numbers. One was for God, 3 was for the Trinity, 4 for the books of the gospels, 5 for the books of Moses, 8 for the beatitudes, 12 for the twelve apostles, 13 for Christ with the apostles.
Ronan eventually got Cathal to fast to save Ronan's soul from damnation. The demon was eventually evicted by holding food up to Cathal's mouth but refusing to let him eat it. The palace was set on fire, and the demon was destroyed within it. The demon appeared like a lizard swaying in Cathal's mouth before eviction.