The mayor would be gunded by income from business and houses in his city.
A mayor could set tax levels lower as other cities to attract people, or higher to get more funds.
From this he could pay extra to city staff like police or fire department, and hold events.
In general: a mayor should try to attrect people to his city and keep it safe.