The need for an election is checked roughly once a year, at least that is what some SE employees have once said on the topic. But certain circumstances can also directly cause SE to hold an election outside of the once a year cycle.
Elections are needed if the number of moderators is too low to effectively handle all the work without overburdening the moderators. This can happen either by moderators resigning or becoming inactive, or by growth of the site. Sometimes the moderators tell SE that they need some more help, sometimes SE just looks at the growth of the site and decides that more moderators would be useful.