What special merit did the tribe of Yehuda have to merit that all kings would descend from him?
יְהוּדָ֗ה אַתָּה֙ יוֹד֣וּךָ אַחֶ֔יךָ יָדְךָ֖ בְּעֹ֣רֶף אֹיְבֶ֑יךָ יִשְׁתַּחֲוּ֥וּ לְךָ֖ בְּנֵ֥י אָבִֽיךָ׃ גּ֤וּר אַרְיֵה֙ יְהוּדָ֔ה מִטֶּ֖רֶף בְּנִ֣י עָלִ֑יתָ כָּרַ֨ע רָבַ֧ץ כְּאַרְיֵ֛ה וּכְלָבִ֖יא מִ֥י יְקִימֶֽנּוּ׃
You, O Judah, your brothers shall acknowledge; Your hand shall be on the nape of your foes; Your father’s sons shall bow low to you. Judah is a lion’s whelp; On prey, my son, have you grown. He crouches, lies down like a lion, Like the king of beasts—who dare rouse him? (Sefaria translation).
The Targum Yonasan ben Uziel notes the reason that the brother will acknowledge and praise him is due to him making a point of confessing the incident of Tamar. Being a true leader means accepting responsibility even when that may draw negative attention:
יְהוּדָה אַנְתְּ אוֹדֵיתָא עַל עוּבְדָא דְתָמָר בְּגִין כֵּן לָךְ יְהוֹדוּן אֲחָךְ וְיִתְקְרוּן יְהוּדָאִין עַל שְׁמָךְ יְדָךְ יִתְפַּרְעוּן לָךְ מִבַּעֲלֵי דְבָבָךְ לְמִפְתַק גִירִין לְהוֹן כַּד יְחַזְרוּן קְדַל קֳדָמָךְ וִיהוֹן מַקְדִימִין לְמִישְׁאַל בִּשְׁלָמָךְ בְּנַי אֲבוּךְ
Yehuda, you made known the matter of Tamar: therefore your brothers shall praise you, and shall be called 'Yehudim' (derived) from your name. Your hand shall avenge me of my adversaries, in throwing arrows upon them when they turn their backs before me; and the sons of my fathers shall come before me with salutations.
A final reason is because he was such a natural leader, the brothers accepted him as king. It is written in Bereishis Rabbah 84:17:
...בִּשְׁלשָׁה מְקוֹמוֹת דִּבֵּר יְהוּדָה בִּפְנֵי אֶחָיו וְעָשׂוּ אוֹתוֹ מֶלֶךְ עֲלֵיהֶם
In three places Yehuda spoke before his brothers and they made him king over themselves...