R. Dr. David Katz discusses this phenomenon:
There were only two occasions where the communal rabbi was actually expected to preach to his community. First there was the pair of Sabbaths, the Sabbath before Passover, and the Sabbath before Yom Kippur. These were occasions where, according to the Talmud (Megillah 32a) since the days of Moses the official communal rabbi was supposed to instruct his flock as to the halakhic regulations of these two holidays.
[...]
In addition to dry halakhic material, the communal rabbi was expected to deliver a kind of religious "State of the Community" address in which he called attention to, and admonished them to repent from whatever sin or sins were popular at the moment.
[...]
The two pre-holiday speeches were basic to the communal rabbinic funtion, and were routinely included in rabbinic contracts, including Ezekiel Landau's contract with the community of Prague...There was one other occasion when the Polish rabbi was expected to speak publicly, although this was not formally stipulated. The rabbi was expected to deliver eulogies for distinguished men and women, especially famous rabbis.
Outside of these occasions the communal rabbi was not expected to deliver public addresses. However, the rabbi was not restricted to these occasions. He could speak whenever he deemed appropriate, especially on special calendar dates, such as the annual religious festivals, the special penitential periods of the months of Elul and Tishrei, and the anniversary of the death of Moses (the 7th of Adar). There were also inaugural sermons, farewell sermons, and celebrations of publication of a book, the concluding of the study of the Talmud or one of its tractates, or the founding of a school or a society.
This preaching flexibility allowed those rabbis with an inclination and/or talent for preaching to exercise their abilities, while relieving those who were not so inclined. It seems that most Ashkenazic rabbis preached the minimum: The two Sabbaths per year, a funeral or two, and perhaps a little more.
The above discussion discusses central and Eastern Europe about 250-300 years ago.
Source: unpublished doctoral dissertation: A Case Study in the Formation of a Super-Rabbi: The Early Years of Rabbi Ezekiel Landau, 1713-1754, pp. 302-304.