The Talmud discusses qualifications for membership on the Sanhedrin and the nature of gedolei Yisrael, listing qualities such as wisdom, humility, awe of heaven, integrity, and popularity with the community. A 'gadol' in the halakhic-institutional sense is one recognized by the community for these combined virtues.
הָא אִיכָּא אַחֲרִיתִי, דְּתַנְיָא: אֵין מוֹשִׁיבִין בְּסַנְהֶדְרִין זָקֵן וְסָרִיס וּמִי שֶׁאֵין לוֹ בָּנִים. רַבִּי יְהוּדָה מוֹסִיף: אַף אַכְזָרִי. וְחִילּוּפֵיהֶן בְּמֵסִית, דְּרַחֲמָנָא אָמַר: ״לֹא תַחְמֹל וְלֹא תְכַסֶּה עָלָיו״. וְאֵין הַכֹּל כְּשֵׁרִין לָדוּן דִּינֵי נְפָשׁוֹת. מַאי טַעְמָא? דְּתָנֵי רַב יוֹסֵף: כְּשֵׁם שֶׁבֵּית דִּין מְנוּקִּין בְּצֶדֶק, כָּךְ מְנוּקִּין מִכׇּל מוּם. אָמַר אַמֵּימָר, מַאי קְרָא: ״כֻּלָּךְ יָפָה רַעְיָתִי וּמוּם אֵין בָּךְ״.
The Gemara answers: But there is another difference, as it is taught in a baraita (Tosefta 7:5): The court does not seat on the Sanhedrin a very old person or one who is castrated or one who has no children, as those who did not recently raise children may lack compassion. Rabbi Yehuda adds: Even a cruel person is not eligible. The Gemara comments: And the opposite of this is the halakha with regard to one who entices others to engage in idol worship, as the Merciful One states concerning him: “Neither shall you spare, neither shall you conceal him” (Deuteronomy 13:9). § The mishna teaches: But not all are fit to judge cases of capital law; the judges may be only priests, Levites, or Israelites who are of sufficiently fit lineage to marry their daughters to members of the priesthood. The Gemara asks: What is the reason for this? The Gemara explains: As Rav Yosef taught: Just as the court is clean in justice, so too, it is clean of any blemish, i.e., it does not include anyone of flawed lineage. Ameimar says: What is the verse from which it is derived? It states: “You are all fair, my love; and there is no blemish in you” (Song of Songs 4:7).