The Talmud teaches that all prayers from around the world ascend to the
Western Wall in Jerusalem, from where they then ascend to heaven.
The Talmud says: "If someone is praying outside the Land of Israel, he should direct his heart in the direction of Israel. If the person is praying in Israel, he should direct his heart toward Jerusalem. Those in Jerusalem should direct their hearts to the Temple. As the Bible says, "And they will pray to you through the land which You gave to their fathers, the city which You chose, and the house which I have built in your name" (I Kings 8:48).
Since the Jerusalem Western Wall is a surviving remnant of the Holy Temple in Jerusalem it became the center of the spiritual world.
The Talmud is a record of rabbinic discussions pertaining to Jewish law,
ethics, customs, and history.
The Talmud has two components: the Mishnah and the Gemara. The terms Talmud and Gemara are often used interchangeably. The Gemara is the basis for all codes of rabbinic law and is much quoted in other rabbinic literature.
Originally, Jewish scholarship was oral. Rabbis expounded and debated the
law and discussed the Tanah without written works. This situation changed
drastically, however, mainly as the result of the destruction of the
Jerusalem Temple and Jewish commonwealth and the consequent upheaval of Jewish social and legal norms. As the Rabbis were required to face a new
reality-Judaism without a Jerusalem Temple and Judea without autonomy-there was a flurry of legal discourse and the old system of oral scholarship could not be maintained. It is during this period that Rabbinic discourse began to be recorded in writing.
The Jerusalem Talmud or Talmud Yerushalmi, often the Yerushalmi for short, and also known as the Palestinian Talmud, is a collection of Rabbinic notes about the Jewish Oral tradition in Kabbalah as detailed in the 2nd-century Mishnah. The Jerusalem Talmud predates its counterpart, the Babylonian Talmud, by about 200 years and is written in both Hebrew and Aramaic. It includes the core component, the Mishna, finalized by Rabbi Judah the Prince (c. 200 CE) along with the written discussions of generations of rabbis in the Land of Israel .
There are two recensions of the Gemara, one compiled by the scholars of the
Land of Israel and the other by those of Babylonia. The Babylonian Talmud
is often seen as more authoritative and is studied much more than the
Jerusalem Talmud. In general, the terms "Gemara" or "Talmud", without
further qualification, refer to the Babylonian recension.
The Talmud explains that after the Temple's destruction, the Divine
Presence will never leave the Western Wall. For this reason, the Wall will
never be destroyed. The Wall is endowed with everlasting sanctity. The
Talmud (Megillah 3:3) says: "And I will make your sanctuaries desolate"
(Leviticus 26:31) - this means that the sanctuaries retain their sanctity
even when they are desolate.
So writing a prayer on a piece of paper and sticking it in the Western Wall
is like having a continual prayer linked to the prime source.