The Geonic Period
From its earliest days, Judaism viewed the Tanakh (Hebrew Bible) as the rule book for Jewish ritual and civic behavior. But even before the close of the biblical period (roughly 515 BCE), there emerged a system of interpretation and application for these laws, which were often communicated by the Tanakh in only the most general terms. Over time these interpretations, rulings, and teachings came to be called halakhah, from the Hebrew word for "walking" and "path."
It was not until Rabbi Judah Ha-Nasi and his rabbinic colleagues redacted the Mishnah in the late second century CE that much of this "Oral Torah" came to be organized and written down. Over the next four- to five-hundred years the rabbis created and developed the classical forms of halakhic thinking and its source texts: the Mishnah, Midrash Halakhah, Tosefta, and Talmud. By the late sixth or early seventh century CE, the final redaction of the Babylonian Talmud was complete.
The Geonic period, named after the Geonim, the heads of the rabbinic academies in Babylonia, followed. During this time Babylonia was the spiritual and political center of Diaspora Jewry, and Jewish communities looked to the Geonim for authoritative teachings on halakhic matters. Under the leadership of Geonim such as Rabbi Yehudai, R. Amram, R. Saadia, R. Samuel ben Hophni, R. Sherira, and R. Hai, the Babylonian Talmud became the primary authoritative text for deciding halakhic matters. The Geonim and their colleagues were also responsible for the explosive growth of other distinctive genres of halakhic literature, namely Perushim & Hidushim (talmudic commentaries and novellae), She'ilot u' Teshuvot (responsa), and codes.
The first of these genres, Perushim & Hidushim, continued the work of interpreting the earlier talmudic literature. Perhaps the most famous example of this is R. Aha's Sefer ha-She'iltot (Book of Questions), an eighth-century collection of halakhic interpretations arranged in the order of the weekly Torah portions.
By the time of the Geonim, halakhic literature had become so prolific and complex that many rabbis found it increasingly difficult to master all the necessary material. In response, the first attempts were made to codify, or at least organize, the growing body of halakhah into a more convenient form.