Q. There is a popular Zemer sung on Shabbos morning beginning with the words “Chai HaShem Uvaruch Tzuri”.
Most of the stanzas, while not making any overt mention of Shabbos, are understandable. However, there is one phrase that is very puzzling:
“Tzom’a Nafshi El HaShem, Yemaleh Sova Asamai, El Heharim Essa Einai, Kehillel Velo KeShammai.”
What is the deal here with Hillel and Shammai?

A. There are many different interpretations to this cryptic verse, I’ll just quote a few. Most Meforshim explain that it refers to the disagreement quoted in Talmud (Beitza 16a): They said about Shammai the Elder that all his days he would eat in honor of Shabbos. How so? If he found a choice animal, he would say: This is for Shabbos. If he subsequently found another one choicer than it, he would set aside the second for Shabbos and eat the first. However, Hillel the Elder had a different trait, that all his actions, including those on a weekday, were for the sake of Heaven, as it is stated:(Tehilim 68: 20), “Blessed be Hashem, day by day;” Thus showing great and constant trust in Hashem, going thus back to “El Heharim” to our forefathers. (Birchas Chaim p. 276, Nofech Misheli p. 128, Oitzar Bolum p.31, Ikvei Yaakov p. 11, Beis Hamedrash Hechodosh, et. al.).
Yismach Yisroel (p. 357) explains that it relates to the difference of opinion concerning Chanuka lighting.(Shabbos 21b). Beis Shamai maintain that one lights the first day eight lights and henceforth, every day that passes he diminishes one. While Bais Hilel rules the opposite, and he keeps on adding every day one more light. He sees in the machlokes a difference of opinion as to what is a more correct approach in keeping mitzvos in general and in our case Shabbos. According to Shamai it is best to first abandon wrongs by doing proper teshuva. Only after the “sur merah” or abstaining from evil has been accomplished as a hachana or preparation to the mitzva, one should engage in doing good and perform the wanted will of Hashem. While Hillel advises not to delay and perform the mitzva immediately, while he also engages in performing teshuva and cleaning the soul.
Yashresh Yaakov (p. 101) sees the difference of opinions as simply who had the majority of the people with them. Hillel did and he was united with them and therefore the Halacha is like him. Shabbos together with teshuva are supposed to unite all, as it was when the Torah was given.
Mateh Yehuda (quoted in Meotzreinu Hayashan, Shemos 226). understands this as a reference to the disagreement as to the order of the brochos in kidush (Brochos 53a). This linguistic string follows the prior verse of “Kos Yeshuos,” I will lift the cup of salvation. We follow Hillel’s opinion that the blessing on the wine precedes the brocho on the holiness of the day.
Others see the humility and “ahavas habrios” love of others, prevalent in Hillel’s demeanor (Avos 1: ), which is essential in inviting and bringing people closer to “El Heharim,” their origins, by having them as guest on the Shabbos Table. (Minchas Aviv 2:)
There is another popular nusach or version that mentions “Kehillel Ukeshamai,” (Divrei Chaim, Sadigura, Shomrei Emunim, et. al.). According to some, it meant that there was no real Torah disagreement between them on this particular Shabbos approach, they simply were referring to their personal life experiences, and therefore different resulting conceptions and methods. Hillel suffered poverty, while Shamai did not. (Ikvei Yaakov p. 11).
Others explain that although in our days the Halacha follows Hillel, this stanza makes reference to the days of Moshiach, when the Halacha will follow Shamai. (Beer Hachasidus, quoting Arizal, p. 184).
Horav Dovid Pam Shlit’a pointed that Mishna Berura (250: 2) mentions that many Poskim maintain that Hillel himself would agree that Shamai’s opinion is better.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a