From Atonement to Attunement
This is the discussion on the origin of Tefillah as it appears in Bavli B'rachot, 26B as an expansion of an argument over the times of the daily tefillot. The Bold English text is the translation of the Hebrew text, The text in the regular font was added to make the English scan more easily.
איתמר רבי יוסי ברבי חנינא אמר תפלות אבות תקנום רבי יהושע בן לוי אמר תפלות כנגד תמידין תקנום
The dispute between the Rabbis and Rabbi Yehuda with regard to the times beyond which the different prayers may not be recited is rooted in a profound disagreement, also manifest in a later amoraic dispute. It was stated: Rabbi Yosei, son of Rabbi Ḥanina, said: The practice of praying three times daily is ancient, albeit not in its present form; prayers were instituted by the Patriarchs. However, Rabbi Yehoshua ben Levi said that the prayers were instituted based on the daily offerings sacrificed in the Holy Temple, and the prayers parallel the offerings, in terms of both time and characteristics.
תניא כוותיה דר' יוסי ברבי חנינא ותניא כוותיה דרבי יהושע בן לוי תניא כוותיה דרבי יוסי בר' חנינא אברהם תקן תפלת שחרית שנא' (בראשית יט, כז) וישכם אברהם בבקר אל המקום אשר עמד שם ואין עמידה אלא תפלה שנאמר (תהלים קו, ל) ויעמד פינחס ויפלל
The Gemara comments: It was taught in a baraita in accordance with the opinion of Rabbi Yosei, son of Rabbi Ḥanina, and it was taught in a baraitain accordance with the opinion of Rabbi Yehoshua ben Levi. The Gemara elaborates: It was taught in a baraita in accordance with the opinion of Rabbi Yosei, son of Rabbi Ḥanina: Abraham instituted the morning prayer, as it is stated when Abraham came to look out over Sodom the day after he had prayed on its behalf: “And Abraham rose early in the morning to the place where he had stood before the Lord” (Genesis 19:27), and from the context as well as the language utilized in the verse, the verb standing means nothing other than prayer, as this language is used to describe Pinehas’ prayer after the plague, as it is stated: “And Pinehas stood up and prayed and the plague ended” (Psalms 106:30). Clearly, Abraham was accustomed to stand in prayer in the morning.
יצחק תקן תפלת מנחה שנאמר (בראשית כד, סג) ויצא יצחק לשוח בשדה לפנות ערב ואין שיחה אלא תפלה שנאמר (תהלים קב, א) תפלה לעני כי יעטף ולפני ה' ישפוך שיחו
Isaac instituted the afternoon prayer, as it is stated: “And Isaac went out to converse [lasuaḥ] in the field toward evening” (Genesis 24:63), and conversation means nothing other than prayer, as it is stated: “A prayer of the afflicted when he is faint and pours out his complaint [siḥo] before the Lord” (Psalms 102:1). Obviously, Isaac was the first to pray as evening approached, at the time of the afternoon prayer.
יעקב תקן תפלת ערבית שנאמר (בראשית כח, יא) ויפגע במקום וילן שם ואין פגיעה אלא תפלה שנאמר (ירמיהו ז, טז) ואתה אל תתפלל בעד העם הזה ואל תשא בעדם רנה ותפלה ואל תפגע בי
Jacob instituted the evening prayer, as it is stated: “And he encountered [vayifga] the place and he slept there for the sun had set” (Genesis 28:11). The word encounter means nothing other than prayer, as it is stated when God spoke to Jeremiah: “And you, do not pray on behalf of this nation and do not raise on their behalf song and prayer, and do not encounter [tifga] Me for I do not hear you” (Jeremiah 7:16). Jacob prayed during the evening, after the sun had set.
ותניא כוותיה דר' יהושע בן לוי מפני מה אמרו תפלת השחר עד חצות שהרי תמיד של שחר קרב והולך עד חצות ורבי יהודה אומר עד ארבע שעות שהרי תמיד של שחר קרב והולך עד ארבע שעות
nd it was taught in a baraita in accordance with the opinion of Rabbi Yehoshua ben Levi that the laws of prayer are based on the laws of the daily offerings: Why did the Rabbis say that the morning prayer may be recited until noon? Because, although the daily morning offering is typically brought early in the morning, it may be sacrificed until noon. And Rabbi Yehuda says: My opinion, that the morning prayer may be recited until four hours into the day, is because the daily morning offering is sacrificed until four hours.
ומפני מה אמרו תפלת המנחה עד הערב שהרי תמיד של בין הערבים קרב והולך עד הערב רבי יהודה אומר עד פלג המנחה שהרי תמיד של בין הערבים קרב והולך עד פלג המנחה
And why did the Rabbis say that the afternoon prayer may be recited until the evening? Because the daily afternoon offering is sacrificed until the evening. Rabbi Yehuda says that the afternoon prayer may be recited only until the midpoint of the afternoon because, according to his opinion, the daily afternoon offering is sacrificed until the midpoint of the afternoon.
ומפני מה אמרו תפלת הערב אין לה קבע שהרי אברים ופדרים שלא נתעכלו מבערב קרבים והולכים כל הלילה
And why did they say that the evening prayer is not fixed? Because the burning of the limbs and fats of the offerings that were not consumed by the fire on the altar until the evening. They remained on the altar and were offered continuously throughout the entire night.
ומפני מה אמרו של מוספין כל היום שהרי קרבן של מוספין קרב כל היום רבי יהודה אומר עד שבע שעות שהרי קרבן מוסף קרב והולך עד שבע שעות
And why did the Rabbis say that the additional prayer may be recited all day? Because the additional offering is brought throughout the entire day.However, Rabbi Yehuda says that the additional prayer may be recited until the seventh hour of the day, because the additional offering is sacrificed until the seventh hour.
Is prayer answered? If God is changeless, how can we change Him by what we say? Even discounting this, why do we need to articulate our requests? Surely God, who sees the heart, knows our wishes even before we do, without our having to put them into words. What we wish to happen is either right or wrong in the eyes of God. If it is right, God will bring it about even if we do not pray. If it is wrong, God will not bring it about even if we do.
…Why pray? The classic Jewish answer is simple but profound. Without a vessel to contain a blessing, there can be no blessing. If we have no receptacle to catch the rain, the rain may fall, but we will have none to drink. If we have no radio receiver, the sound-waves will flow, but we will be unable to convert them into sound. God’s blessings flow continuously, but unless we make ourselves into a vessel for them, they will flow elsewhere. Prayer is the act of turning ourselves into a vehicle for the Divine. Prayer changes the world because it changes us. Jonathan Sacks, Introduction to the Authorised Daily Prayer Book
רמב"ם הלכות תפילה ונשיאת כפים פרק א הלכה א
מצות עשה להתפלל בכל יום שנאמר ועבדתם את ה' אלהיכם, מפי השמועה למדו שעבודה זו היא תפלה שנאמר ולעבדו בכל לבבכם אמרו חכמים אי זו היא עבודה שבלב זו תפלה, ואין מנין התפלות מן התורה, ואין משנה התפילה הזאת מן התורה, ואין לתפלה זמן קבוע מן התורה.
It is a positive commandment to pray every day, as it is said, "You shall serve the Lord your God." From here they interpreted that this means tefillah, as it says “to serve Him with all your hearts.” The Sages asked “What is service from the heart? It is tefillah.” But there is no fixed number of tefillot, no fixed format, and no set time for tefillah in the Torah.


Maimonides Laws of Tefillah 1:1
השגות הרמב"ן לספר המצוות לרמב"ם מצות עשה ה
אלא ודאי כל ענין התפלה אינו חובה כלל אבל הוא ממדות חסד הבורא ית' עלינו ששומע ועונה בכל קראינו אליו. ועיקר הכתוב ולעבדו בכל לבבכם מצות עשה שתהיה כל עבודתינו לאל ית' בכל לבבנו כלומר בכוונה רצויה שלימה לשמו ובאין הרהור רע, לא שנעשה המצות בלא כונה או על הספק אולי יש בהם תועלת.
Prayer is not obligatory at all but it is by the grace of the Creator that He listens and answers when we call Him. And the essence of the verse “ to serve with all your hearts’ is that it is a positive commandment that all we do should be directed towards God “with all our hearts”, that is, with intent (kavannah), in His name and without evil thoughts, and not to do mitzvoth without intent or believing they serve no purpose.
Nachmanides on Maimonides Sefer Hamitzvot