The legend concerns how Macha, pregnant at the time and VERY close to her due date, was forced by the King of Ulster to a footrace against his horses. She begged everyone she could to stop the race, but no one would.
She won the race, dropped in heavy labor, then, after delivering twins, set the curse upon the Sons of Ulster: "For nine generations, when the need for your strength is the greatest, you will suffer the pains of labor for four days and four nights."
I believe it is one of the side stories mentioned in the Tain (but I may be mistaken). Happy hunting ;D.