As told in the Mabinogion,
The Welsh national Epic
There once was a king named Math who had a severe Celtic disorder. He could only live if his feet rested in the lap of a virgin, unless, of course, he was at war. Then he could roam anywhere at will. King Math had two nephews whose names were Gwydyon and Gilvaethwy. Gilvaethwy had wicked designs on the beautiful virgin Goewin, in whose lap Math rested his feet.
Unable to get the beautiful Goewin alone so he could have his way with her, Gilvaethwy and his brother devised a plan to get Math to go to war. They had heard that a neighboring King, Pryderi had a very special herd of pigs (Moch) that belonged to him and to his people. Because their flesh was sweeter than that of Oxen, Pryderi had promised his people that the Moch(pigs) would make them rich, but that not one Mochyn (pig) would be touched until the herd had doubled in size
Gwydyon and Gilvaethwy disguised themselves as bards and went to Pryderi's kingdom where, according to Welsh custom, they were invited to Pryderi's table to feast. They all recited poetry and ate and drank. After a flask or two too many Pryderi said that Gwydyon and Gilvaethwy's poetry was the best he ever heard and offered them a gift of whatever they wanted. Gwydyon and Gilvaethwy asked Pryderi if they could have his Moch. Pryderi of course said no, that the Moch belonged to his people and were to make them rich, but he said that after the herd had doubled in size, Pryderi would gladly give them some pigs. But Gwydyon and Gilvaethwy said they would give Pryderi something much more valuable then the pigs, and his people would be satisfied.
Gwydyon and Gilvaethwy, through magic, conjured up a herd of beautiful stallions each one with golden bridles and golden saddles. Not knowing about the magic Pryderi and his people saw the herd of stallions and were duly impressed. They thought it would be a good trade. The deal was struck and Gwydyon and Gilvaethwy set off with the herd of pigs as quickly as possible for they knew that the herd of magic stallions with the golden bridles and the golden saddles would only last for 24 hours. Then they would disappear !!
On their long journey home everywhere they stopped took on the name of "pig" so that to this day there are towns called "Pigtown" and "Pig Springs". They finally arrived back at Math's kingdom, where they hid the pigs, and told Math nothing.
After 24 hours the stallions with the golden saddles and the golden bridles all disappeared and King Pryderi saw he had been tricked. He gathered together a great army and set out in pursuit of Gwydyon and Gilvaethwy and his pigs. When King Math saw a great army about to enter his lands, he called together his army and set out for war. Finally the beautiful Goewin was alone and Gilvaethwy had his way with her against her wishes.
In single combat between Math and Pryderi, Pryderi was mortally wounded and later died. Math returned home to discover that Goewin though beautiful was no longer a virgin, but he married her and made her his queen. In his anger he took his wand and changed Gwydyon and Gilvaethwy into a hind and a stag so they would mate. After one year they returned with their foal and he changed them into a wild boar and a wild sow and kept their first child for his own and called him Hyddwn. After the second year the boar and sow returned with their young one and Math took their child for his own and called him Hychdwn. He then changed Gwydyon and Gilvaethwy into a he-wolf and a she-wolf, and after a year they returned with their offspring and Math took him and named him Bleiddwn.
Not in the Mabinogion
After fighting Math in single combat. Pryderi, mortally wounded, was carried home to Gwenydd. Realizing that he had lost his pigs and was about to die he took his revenge on Gwydyon and Gilvaethwy by casting a spell on the pigs. Hence forth the pigs would wallow in mud and filth, much to the disgust of the people of Math's kingdom. A few of the pigs he changed into musicians to play music for the other Moch so they would be forever happy and content. Then Pryderi died.