Whilst Maoz Tzur may be the best known Chanukah song, the prayers of 'Al Hanisim' and 'Bi'mei Matityahu' (from now, I'll refer to both by just 'Al Hanisim') are inserted into every Amida prayer (not to be confused with this even if you go there more often than you pray) and also Birkat Hamazon on Chanukah. Let us take a brief look at these prayers and why. You can find Al Hanisim at the foot of page 90 in the green Siddur and the foot of page 112 in the Artscroll Siddur.
The Talmud (Tractate Shabbat 21b) gives a very brief explanation of the nuts and bolts of some of the Chanukah story. It concludes the explanation by stating that the Rabbis instituted Chanukah as days of hallel ve'hoda'ah (praise and thanks). Rashi writes that the Rabbis did not prohibit any melacha on these days but instead ruled that we should recite Hallel and say Al Hanisim in the 'Hoda'ah' (Modim) section of the Amida.
A little later (page 24a), the Talmud discusses reciting something to do with Chanukah in Birkat Hamazon during Chanukah. Rashi there references us back to page 21b so that we can assume that the discussion regarding Birkat Hamazon also refers to Al Hanisim.
The Talmud states that the reason for reciting Al Hanisim in these prayers is due to the major theme of Chanukah being to thank G-d for all of the Chanukah miracles (at last we may come closer to answering what exactly those miracles were as we've been discussing in Shul). That is why it is placed in the beracha (blessing) of Modim and also in the second beracha in Birkat Hamazon thanking G-d for the Land of Israel.
Therefore, it seems that Rashi on 21b states that Al Hanisim is part of the institution of Chanukah just like lighting candles (but not like eating sufganiyot - that's Hebrew for doughnuts - as we discussed in the previous Chanukah post. I hope you are enjoying the olive oil drizzled on your salad!)
However...it is noteworthy that Rambam appears to disagree. In his great legal magnum opus, Mishnah Torah, the order of the material is a good clue to the Rambam's opinion. Where does he quote the halacha of Al Hanisim? Hands up if you think it is in the Laws of Chanukah...
...well done for keeping that hand down! Interestingly, Rambam instead references Al Hanisim in the Laws of Tefilah (Prayer) 2:13, which we studied in Shul on Shabbat afternoons and also in the Laws of Berachot (benedictions - great word) 2:6.
This codification suggests that Rambam sees Al Hanisim as part of the general structure of thanks in prayer rather than a specific Chanukah institution such as kindling lights.
Tosafot ('Mahu' and 'Mazkir', 24a) appears to demur. In the first comment, Tosafot once again presents the opinion, as attendees at the Wednesday night Talmud class will know, that the main motivation for mentioning Chanukah is to publicise the Chanukah miracles.
In the second comment, Tosafot differs from our presentation of Rambam's position by writing that Al Hanisim is specific thanks to G-d for Chanukah and not part of the general message of thanking G-d in prayer.
Perhaps we can refine our understanding by reviewing the actual text of Al Hanissim. Here is Chief Rabbi Sacks' translation:
"[We thank You also] for the miracles, the redemption, the mighty deeds, and the victories in battle which You performed for our ancestors in those days at this time.
In the days of Mattityahu, son of Yochanan the High Priest, the Hasmonean, and his sons, the wicked Greek kingdom rise up against Your people Israel to make them forget Your Torah and to force them to transgress the statutes of Your will. It was then that You in Your great compassion stood by them in the time of their distress. You championed their cause, judged their claim, and avenged their wrong. You delivered the strong into the hands of the weak, the many into the hands of the few, the impure into the hands of the pure, the wicked into the hands of the righteous, and the arrogant into the hands of those who were engaged in the study of Your Torah. You made for Yourself great and holy renown in Your world, and for Your people Israel You performed a great slavation and redemption on this day. Your children then entered the holiest part of Your house, cleansed Your Temple, purified Your sanctuary, kindled lights in Your holy courts, and designated these eight days of Chanukah for giving thanks and praise to Your great Name."
What is the main theme of this prayer? To me, it seems like it is the military victory and salvation of the Jewish people, along with the rededication of the Beit Hamikdash (Temple). The kindling of lights is mentioned right at the end, seemingly only in connection with the service in the Temple and not in connection with a particular miracle of a light that lasted for eight days.
In fact, the commentary of the Maharsha to Shabbat 21b suggests that the rededication of the Temple is the main celebration of Chanukah.
For a fascinating discussion of the some of these possibilites, see Rabbi Menachem Leibtag's essay on Chanukah which I would strongly recommend that you read.
Conclusion
We have seen some of the background to Al Hanisim. Perhaps its placement in both the Amida and Birkat Hamazon is to inform us that we should be grateful to G-d for saving us on Chanukah as part of our general thanks to G-d. However, it may also inspire us to consider that the specific thanks of Chanukah which are not just limited to physical salvation but also to the fact that we could rededicate the Beit Hamikdash and our continue to live and develop as Jews with Judaism rather than Jews with those aspects of Hellenism which were antithetical to Judaism.
This may explain the differing approaches to Al Hanisim amongst the Rishonim cited above. For Rambam, Al Hanisim is part of the general laws of prayer since it must be placed in the 'thank you' section of the Amida. It is also placed in a similar section of Birkat Hamazon, describing our thanks for the Land of Israel.
For Rashi, Al Hanisim is specifically part of the mitzvot of Chanukah, just like lighting candles.
Both of these approaches should help us enhance our appreciation and enjoyment of Chanukah.
Chanukah Samayach - Happy Chanukah.