The Temple in Jerusalem was rebuilt during the reign of the Persian Emperors sometime between 500 and 450 B.C.E. Those who planned the rebuilding of Jerusalem and the Temple and who served in it were all Jews from the exiled community which had been established in Babylonia at the time of the destruction of the First Temple in 586 B.C.E. Ezra, who is called Ha-Sofer, "The Scribe," was actually one of the higher authorities on Jewish Law; we might describe him as the chief judge, the leading jurist of the courts of the Jewish community in Babylonia.
Nehemiah, who held a high position in the imperial cabinet of the Persian emperor, was sent as Governor of Judah to supervise the rebuilding of the city walls and to organize and arrange local government. All of those who directed the rebuilding and who established the laws of the Torah as the legal basis of Jewish life in the Land of Israel, were Babylonian Jews. Jehoshua, the High Priest who came to serve in the newly rebuilt Temple was a Kohen who had lived and studied in Babylonia. It is obvious from these historical accounts that the Babylonian community was the educated, sophisticated Jewish community, the one that had kept the Torah as its legal system and had built up a tradition of interpretation which served the Jewish communities in Babylonia. When these leaders of the Babylonian Jewish communities came to rebuild the Land of Israel, the City of Jerusalem and to restore the Temple, they brought with them the knowledge and experience and set the foundation of Jewish law and its tradition of interpretation which later expanded and flourished in the Land of Israel.
Eventually a legislative body was organized and established which is known as the Anshei Knesset Ha-Gedolah, the Men of the Great Assembly. This body consisted of interpreters of the Torah who carried on the traditions of the Babylonian Jewish community as taught by Ezra. The Kohanim, or at the very least, leaders among the Kohanim, such as the Kohen Gadol, the High Priest, were also members of this Great Assembly. The tradition preserved in the Pirké Avot tells us that Shimon Ha-Tzaddik, Simon the Just, who was the High Priest in the third pre-Christian century, was a member of that body and is described as "One of the last of the members of the Anshe Knesset Ha-Gedolah." Evidently the Knesset Ha-Gedolah came to an end when the forerunner of the Sanhedrin came into existence, the period known as that of the Zugot, the "Pairs" mentioned in the recorded tradition. The Zugot who are listed were:
Yose ben-Yoezer of Tzeredah and Yose ben-Yohanan of Jerusalem.
Yehoshua ben-Perahia and Nittai of Arbela.
Yehudah ben-Tabbai and Shimon ben-Shetahh.
Shma'yah and Avtalyon.
Hillel and Shammai.
It is apparent that during the period of the pairing of Hillel and Shammai, the Sanhedrin was already established and functioning as the Supreme Court of the Jewish nation. Following the period of Hillel and Shammai the names mentioned in the Mishnah and its auxiliary literature; the so-called Tannaitic literature, are all members of the Sanhedrin or lawyers whose opinions are recorded in this literature.