It is said to be the survival of a pagan fertility playExactly, it is said...
There is no evidence whatsoever that the tradition is more than 150 years old
Quite why people insist on inventing 'pagan origins' for songs, rhymes, customs etc is beyond me