We are learning the ninth Mishnah, the last in the eleventh chapter of Maseches Menachos. Here the Mishnah sums up the subject of the shtei halechem and the lechem hapanim through a discussion of when these breads are actually baked. On Shabbos the matter is clear, since one does not bake on Shabbos. The question concerns Yom Tov: the shtei halechem are eaten on Shavuos - may they be baked on the morning of the festival itself, or must they be baked beforehand? After all, in general melachah is forbidden on Yom Tov just as on Shabbos, except that the Torah permitted the preparation of food on Yom Tov.
The starting point is the verse: "ach asher yei'achel lechol nefesh hu levado yei'aseh lachem" ("only that which is eaten by any person, that alone may be prepared for you") - although melachah is forbidden, whatever is intended for human consumption may be done. This is the allowance of 'ochel nefesh', food needs, on Yom Tov. But we must be precise about the word "lachem" ("for you") at the end of the verse, which appears superfluous, since the verse could have said "ach asher yei'achel lechol nefesh hu levado yei'aseh". What, then, does this word come to exclude?
Two approaches in explaining the exclusion of "lachem":
The opinion of the Tanna Kamma (and this is the halachah): "lachem" - for the sake of human consumption, as opposed to that which is for Heaven. Preparing the bread of the Holy One, blessed is He, is not included in the allowance, and therefore just as the lechem hapanim and the shtei halechem are not baked on Shabbos, so too they are not baked on Yom Tov, since they are not for human consumption but for Heaven.
The dissenting opinion: "lachem" comes only to exclude preparing food for non-Jews, but the bread of the Holy One, blessed is He, so to speak, may be baked on Yom Tov.
"Shtei halechem ne'echalos ein pachos mishnayim v'lo yoser al sheloshah" - the shtei halechem are eaten no less than two days and no more than three days after their baking:
The number of days between the baking of the shtei halechem and their being eaten on Shavuos is not less than two days and not more than three days. How so?
"Ne'efos me'erev Yom Tov v'ne'echalos b'Yom Tov - bishnayim" - they are baked on the eve of Yom Tov and eaten on Yom Tov, which is two days: if Shavuos falls on Tuesday, one does not bake on Yom Tov itself, since the Torah does not permit baking that is not for human consumption; therefore one bakes on Monday and eats on Tuesday - two days.
"Chal Yom Tov lihyos achar haShabbos - bishloshah" - if Yom Tov falls after Shabbos, it is three days: if Shavuos falls on Sunday, one does not bake on the festival itself, nor on the Shabbos before it, and therefore one bakes on erev Shabbos: Friday is the first of the count, Shabbos the second, and Sunday, which is Shavuos, the third.
"Lechem hapanim ne'echal ein pachos mitishah v'lo yoser al achad asar" - the lechem hapanim is eaten no less than nine days and no more than eleven days after its baking:
The lechem hapanim that rests on the Shulchan is set out on Shabbos, removed the following Shabbos and eaten on that day. It follows that it is eaten no less than nine days after its baking and no more than eleven days. How so?
"Ne'efeh b'erev Shabbos v'ne'echal b'Shabbos - litishah" - it is baked on erev Shabbos and eaten on Shabbos, which is nine days: it is not baked on the Shabbos on which it is set out, but on the Friday before it, and it is eaten on the following Shabbos.
"Chal Yom Tov lihyos erev Shabbos - la'asarah" - if Yom Tov falls on erev Shabbos, it is ten days: if Yom Tov falls on Friday - whether on Pesach, Shavuos or Sukkos - one does not bake on it, and therefore one bakes on Thursday, and instead of nine days the count comes to ten.
"Shnei yamim tovim shel Rosh Hashanah - l'achad asar" - the two days of Rosh Hashanah make it eleven days: if the two days of Rosh Hashanah fall on Thursday and Friday, one does not bake on either of them, and therefore one bakes on Wednesday, and from the day it is baked until the Shabbos on which it is eaten the count comes to eleven days.
It is worth being precise in counting the days: some intuitively think that baking on Friday and eating on the following Shabbos comes to eight days, but this is not so; it is nine days. The reason is that there are two Fridays and two Shabbosos here. And this is how one counts: Friday - the first day of the count, Shabbos - the second, Sunday - the third, Monday - the fourth, Tuesday - the fifth, Wednesday - the sixth, Thursday - the seventh, Friday - the eighth, and on the following Shabbos, the ninth day, the bread is eaten.
Regarding the two days of Rosh Hashanah, a clarification is needed: we are dealing with Eretz Yisrael, with Yerushalayim and the Beis HaMikdash, and there is no 'second day of Yom Tov of the Diaspora' there - two days of Pesach and the like as observed outside Eretz Yisrael. Rosh Hashanah, however, was observed for two days even in Eretz Yisrael and even in the Beis HaMikdash, since there was always uncertainty as to whether and when witnesses would come to testify about sighting the new moon, and therefore both possible days are observed from the outset.
This raises a difficulty: if the baking is on Wednesday and Thursday is the first day of Rosh Hashanah, then that Thursday is the first of Tishrei, and the eleventh day - the Shabbos on which the bread is to be eaten - is the tenth of Tishrei, which is Yom Kippur, and one does not eat the bread on Yom Kippur. If so, how can there be a count of eleven days, when there ought to be twelve?
The answer is that the rule in the Beis HaMikdash is that a day is always measured so that the night following it is included in it. This is so regarding the times for eating the offerings: the day on which an offering is eaten includes the day on which it was brought together with the night that follows, and it all counts as a single day. Here too, the lechem hapanim will be eaten on Motzaei Shabbos, which is also the conclusion of Yom Kippur, when permission to eat returns; and although in terms of the count of weekdays this is already Sunday, it is still considered the night of Shabbos, and it is still the eleventh day.
Therefore the Mishnah concludes: "Ve'eino docheh lo es haShabbos velo es Yom Tov" - the baking of these breads, the lechem hapanim and the shtei halechem, does not override Shabbos and does not override Yom Tov, as explained above.
The opinion of Rabban Shimon ben Gamliel in the name of Rabbi Shimon ben HaSegan:
Before we examine his words, let us first identify him. Shimon is an extremely common name among the Tanna'im, and Rabbi Shimon ben HaSegan is the son of Rabbi Chanina, the Deputy Kohen Gadol. Chanina, the Deputy Kohen Gadol, was a kind of second-ranking kohen in the era of the destruction of the Second Beis HaMikdash. He was not the Kohen Gadol, since until the destruction that post was essentially a position that was acquired, but he was the scholar who knew the workings of the Mikdash thoroughly, a kind of deputy to the Kohen Gadol. He testified about several matters in various Mishnayos, and here we are speaking of his son.
According to this opinion, the word "lachem" in the verse "Ach asher ye'acheil lechol nefesh hu levado ye'aseh lachem" does not exclude the needs of the Most High, for the bread of the Holy One, Blessed is He, is not excluded from the rule; rather, it excludes cooking for the needs of non-Jews, for whom one may not cook. Accordingly, one may bake on Yom Tov both the lechem hapanim and the shtei halechem: if Shavuos falls on Yom Tov, one bakes the shtei halechem on the morning of the festival and eats them on that very day; and the lechem hapanim, which is not baked on Shabbos, is baked on Erev Shabbos - even if that Erev Shabbos falls on Yom Tov - and is eaten nine days later.
One may ask: baking on Yom Tov for the sake of eating on that same day is understandable, but how may one bake the lechem hapanim on Yom Tov, when it is not eaten that day but only nine days later? The answer is that although one may not cook or bake on Yom Tov for a need that arises after Yom Tov, this prohibition falls within the realm of rabbinic law, and the Sages did not decree concerning a 'distant shevus' - the concern of cooking now for a need far off in time. For this reason there is no rabbinic prohibition here, and indeed the lechem hapanim is baked on a Yom Tov that falls on Erev Shabbos.
The Mishnah continues: "Docheh es Yom Tov ve'eino docheh es yom tzom" - although one may perform the preparation of food on Yom Tov, one may not do so on Yom Kippur, the day of fasting and affliction, which is a Shabbos Shabbason whose law is like that of Shabbos, and on which there is never cooking or baking. Therefore, if Yom Kippur falls on Erev Shabbos, the lechem hapanim is not baked on Friday but on Thursday, and in such a case there is a count of ten days from the day it was baked, on Erev Yom Kippur, until the Shabbos on which it is eaten.
In summary: in this Mishnah we learned the count of the days between the baking of the breads and their consumption - the shtei halechem from two to three days, and the lechem hapanim from nine to eleven days - as well as the basis of the dispute underlying them: the interpretation of the word "lachem" in the verse "Ach asher ye'acheil lechol nefesh." According to the first Tanna, whose view is the halachah, "lachem" excludes the needs of the Most High, and therefore the baking of the breads overrides neither Shabbos nor Yom Tov; whereas according to Rabban Shimon ben Gamliel in the name of Rabbi Shimon ben HaSegan, "lachem" excludes only non-Jews, and therefore the baking does override Yom Tov, but it does not override the day of the fast.