By Rabbi Herschel Shachter
The gemara (Shabbos 21b) quotes the story of Chanukah from Megillas Taanis (Rashi, Shabbos 13b, explains that this work is referred to as a megillah because it was already written down at the time that the mishnayos were still being learned orally.) The Yevonim were metamei all the oil in the Beis Hamikdash and the Chashmona'im only found one small container of pure oil that should have only lasted for one night. Rav Yaakov Emden (Mor U'Ketzia #670) raises the following major issue: the mishna tells us that liquids in the Beis Hamikdash are not mekabel tummah> so the whole story does not make any sense! The olive oil was a liquid and could not become tameh, so why was there a need for a miracle if there is no such thing as shemen tameh in the Beis Hamikdash?
Some suggest the following answer. The psak of a talmid chochom is binding because he probably had divine assistance in developing his position. And even when there is a machlokes in halacha each yeshiva is obligated to follow its own rebbe, and we assume that this is so because each rebbe was given the divine assistance to formulate his position. The story of Chanukah occurred in the middle of the period of the second Beis Hamikdash over two hundred years before its destruction. In that generation, the accepted psak was that even liquids in the Beis Hamikdash are also mekabel tumah. It was only several generations later, during the period of the zugos, that R' Yosi ben Yoezer's position that liquids in the Beis Hamikdash are tahor was adopted l'halacha. How can it possibly be that Beis Shammai and Beis Hillel each had a divine assistance to come to differing conclusions? The answer is: the gemara says that sometimes when there is a machlokes in halacha we assume eilu v'eilu divrei Elokim chaim. The Ritvah explains that when Moshe Rabbeinu was on Har Sinai and Hashem was teaching him the entire Torah, and Moshe Rabbeinu posed questions to Hashem regarding what the din is in various cases and under various circumstances. In some cases Hashem told him that the din is mutar; in other cases Hashem told him the din is assur; and in other cases Hashem told him that this is a grey area of halacha, with both elements of heter and of issur, and He leaves it up to the judgment of the chachmei ha'dor in each generation to decide based on their perspective of kol haTorah kulla whether the elements of heter outweigh the elements of issur or the reverse.
Every so often in the gemara we find that in different generations the consensus amongst the rabbonim shifted and the psak was changed. The two positions are often referred to mishna rishonah and mishna acharona. The gemara tells us that for the four hundred and ten years of the first Beis Hamikdash the Kohanim fulfilled the mitzvah of nisuch hayayin in one fashion. When the second Beis Hamikdash was built (after the seventy years of galus Bavel), the chachomim of that generation decided to do the nisuch hayayin in a different fashion. The Sfas Emes in his commentary on that gemara raises a question, does that mean that during for all of the four hundred and ten years of the first Beis Hamikdash they were never properly yotzei the mitzvah of nisuch hayayin?! The simple answer is that eilu v'eilu divrei Elokim chaim. Since both groups of chachomim were knowledgeable in kol haTorah Kulah and both were working within the framework of the middos sheHaTorah nidreshes bohem, both positions were considered correct. During the Bayis Rishon period the correct halachic position was in accordance with the consensus of that time and during the Bayis Sheini period the correct halachic position was in accordance with the consensus of that era.
Similarly, if the story of chanukah would have occurred a few generations later, Hashem would not have caused any miracle to occur because the accepted psak was like R. Yosi ben Yoezer that the olive oil cannot become tameh. But in the generation of the Chasmona'im the Ribbono Shel Olam went along with the psak of the consensus of that generation and caused the nes to occur.