When I was recently learning Sotah I saw on daf 48b that Tzadok, during the time of Dovid HaMelech, was a rare instance during that period, of someone who asked the Urim VeTumim and was answered.
רַב נַחְמָן אָמַר בִּימֵי דָּוִד זִימְנִין סְלֵיק וְזִימְנִין לָא סְלֵיק שֶׁהֲרֵי שָׁאַל צָדוֹק וְעָלְתָה לוֹ שָׁאַל אֶבְיָתָר וְלֹא עָלְתָה לוֹ שֶׁנֶּאֱמַר וַיַּעַל אֶבְיָתָר
Rav Naḥman said: In the days of David there were times an answer rose up for them from the Urim VeTummim and there were times an answer did not rise up, i.e., they did not receive an answer. The proof for this is that Tzadok, the High Priest in David’s time, asked the Urim VeTummim and an answer rose up for him, whereas Abiathar asked and an answer did not rise up for him, as it is stated: “And Abiathar went up” (II Samuel 15:24), and he was removed from serving as the High Priest as a result. (Sefaria translation and notation)
The mefarshim (commentaries) there explain that by virtue of the fact that the Urim VeTumim answered Tzadok, he was later installed as Kohen Gadol.1
So this piqued my curiosity, and I began to look into this personality of Tzadok, and I came across a fascinating Midrash in Koheles Rabbah 1:4 which writes as follows:
אָמַר רַבִּי סִימָאִי כְּתִיב (דברי הימים א ו, לד): וְאַהֲרֹן וּבָנָיו מַקְטִירִים עַל מִזְבַּח הָעוֹלָה וגו', וְכִי אַהֲרֹן וּבָנָיו קַיָּמִים, וַהֲלֹא צָדוֹק וּבָנָיו הָיוּ, אֶלָּא לְלַמֶּדְךָ שֶׁאִלּוּ הָיָה אַהֲרֹן וּבָנָיו קַיָּמִים, צָדוֹק הָיָה גָדוֹל מֵהֶם בִּשְׁעָתוֹ.
Rav Simai says it writes (in Divrei HaYamim I 6:34), "But Aaron and his sons made offerings upon the altar of burnt offering etc." - And when Aharon and sons were alive would not Tzadok and his sons been. Rather to teach you that had Aharon and his sons been alive, Tzadok would have been greater than them in his time.
Do we know any more about the Kohen Gadol Tzadok? What made him so great that he is viewed as being conceivably greater than Aharon and his sons?
1 The Metzudas Dovid writes on the pasuk brought in the Gemara that after Evyasar was not answered, Tzadok was named Kohen Gadol. Following Evyasar's forcible removal, Tzadok was later installed during Shlomo HaMelech's reign.