The custom may be nothing more than locals electing a figure to ridicule a particular dignitary or to protest (originally) at some local injustice.
However, the practice is relatively widespread and in some places carries extra duties, so the origins may go deeper. Associations with Mock Mayors include, in Yarmouth, settling disputes amongst fishermen and in Newcastle on Tyne, a Guy Fawkes like celebration.
There is evidence that the custom was much more widespread than it is now, with almost each village in England electing a Mock Mayor. The season does not tally with the suggestion that it is related to Lord Of Misrule and so this particular liaison cannot be made.
In Woodstock, the election takes place at the end of the Parish Feast Day in August. With a procession and robes, the Mayor leads off to the river where he is ritually dunked. The ceremony is alleged to be ancient but may signify no more than a dispute between two villages which were once separate on either side of the River Glyme. One side may have resented the pomposity of the other when they were merged.