Just as modern sports, ancient sports had rules. For a rider for example it was forbidden to turn in the hippodrome before the turning pole, for a runner to take a false start, for a pankratiast to gouge his opponent, ... In the Olympic oath the athletes swore not to cheat.
Nevertheless offences were sometimes inevitable committed in the thick of the fight. That is why all contests were supervised by umpires. Offenders were punished corporally with a beating of a stick or a whip.
This was a heavy punishment, not only physically, but also psychologically. Outsite the context of games, corporal punishments to free men were not allowed. They were only used in the education of children and in particular for slaves. The punishments at the games probably had a religious significance: the athletes had sworn to Zeus to compete honestly and, if they cheated, they insulted the god by their behaviour.