"principal officer of a municipality, chief magistrate of a city or borough," c. 1300, mair, meir (mid-13c. as a surname), from Old French maire "head of a city or town government" (13c.), originally "greater, superior" (adj.), from Latin maior, major, comparative of magnus "great, large, big" (of size), "abundant" (of quantity), "great, considerable" (of value), "strong, powerful" (of force); of persons, "elder, aged," also, figuratively, "great, mighty, grand, important," from PIE *mag-no-, from root *meg- "great."
Mayoress is attested from late 15c. as "the wife of a mayor;" by 1863 as "woman holding the office of mayor."
word-forming element; see -al (1) + -ity. Originally also in reduced form -alty, especially in words from French (mayoralty, etc.), hence the occasional doublet such as fealty/fidelity, realty/reality, specialty/speciality, loyalty/legality.
<a href="https://www.etymonline.com/word/mayoralty">Etymology of mayoralty by etymonline</a>
Harper, D. (n.d.). Etymology of mayoralty. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/mayoralty