Asking God for peace and protection in this evening prayer.
The Bedtime Shema or Kriat Shema al Hamitah, is an extended version of the traditional Shema prayer and is recited before going to sleep.
The Torah prescribes that one should recite the Shema "when you lie down and when you rise up" (Deuteronomy 6:7, 11:9).
Nowadays, this is manifested in the inclusion of the prayer in the Shaharit (morning) and Ma'ariv (evening) services. However, an additional practice of reciting the Shema before going to sleep developed in rabbinic times.
The source of the bedtime Shema can be found in the Talmud, where Rabbi Yehoshua ben Levi asserts that one should recite the Shema before bed, even though it was also recited with the evening prayers (Berakhot 4b). In explaining the biblical source of the practice, Rav Assi brings a verse from the book of Psalms, "So tremble, and sin no more; ponder it on your bed, and sigh" (Psalms 4:5).
Night was considered a time of vulnerability, when one's soul returned to God. In attempting to understand the motivation for saying the Shema at this time, Rav Yitzchak asserts, "If one recites the Shema before bed, demons are kept away from him" (Berakhot 5a). The general consensus of the rabbis from the time of the Talmud to the time of the halakhic codes is that reciting this Shema offers not only praise of God, but a request of God’s protection from dangers and demons that may emerge at night.
During the Geonic Period, the siddur of ninth century Rav Amram Gaon records that one should recite a significantly longer liturgy rather than simply the first line of the Shema. This longer form became the basis for the traditional bedtime Shema still used today. However, when discussing the nature of Kriat Shema al Hamitah, Rav states a person can simply recite the first line of the Shema and fulfill the obligation for the entire Bedtime Shema (Berakhot 13b), and this has become a popular practice.
The extended version of the bedtime Shema is composed of a combination of selections from daily prayers, particularly from the Ma'ariv service, interspersed with biblical verses and other proscribed liturgies. Many of the passages recited are taken from the commentaries on the bedtime Shema in the Talmud.
Following an introductory passage where one informs God that he or she will forgive anyone who has wronged that person during the day, the prayer begins with a blessing ordained by the rabbis of the Talmud, Birkat HaMapil, or the blessing of the one who brings one down to sleep. The prayer states, "Praised are You, Adonai our God, who rules the universe, bringing sleep to my eyes and slumber to my eyelids" (Berakhot 60b). It also asks God to protect the individual so that he or she may "lie down in peace and arrive in peace," hoping that the next day will bring new light, for God’s "glory gives light to the entire world."
The middle section begins the traditional first line of the Shema. It is followed by the first full paragraph, known (for its first word) as V’ahavtah, followed by other liturgical passages from the Ma'ariv service. These include most of the Hashkiveinu prayer, which asks for protection, as well as parts of from Barukh Adonai L’Olam. The one constant theme among the verses is the notion that God should protect us when rising up and lying down, no doubt bringing attention to the fact that sleep is a transitional state.