The Gemara (also known as the Talmud or Oral Torah ), an explanation of the Written Torah, was given to Moshe at Sinai. Without the Talmud the Written Torah can't be understood. There are a lot of critical facts and points that are only hinted at or not even mentioned in the Written Torah that were explained in the Talmud. The Gemara was not allowed to be formally written down; It was only memorized and transmitted from teacher to student through out the generations. With time the generations started to forget the laws of the Gemara. The sages realized that if the Oral Torah would not be written down, it would be lost. Rabbi Yehuda ha-Nasi, the head of the generation, gathered the rabbis of that generation and the Mishna was written. The Mishna contains a brief listing of the Jewish Laws. With time people failed to understand the meaning of the Mishna, so that the Gemara was written. The Gemara and the Mishna together are called the Talmud. The Gemara debates, dissects, and defines the principles of the Mishna so that the halacha could be understood. The Alter Rebbe in the Tanya states that the Talmud is a manifestation of G-d's will, which is even higher than the level of Chochma, wisdom. By studying the Talmud and delving into the debates and complex issues discussed, a person's mind becomes one with G-d's will in a perfect unity, making the person's mind G-dly.