TT #114 · Parashas Shoftim · Second Aliyah · Passuk 17:20
So that his heart not be lifted above his brethren, and so that he not turn aside from the commandment to the right or to the left, in order that he may prolong days over his kingdom, he and his sons, in the midst of Yisrael.
Torah Temimah points to Sanhedrin 22a.
TT lemma: לְבִלְתִּי רוּם לְבָבוֹ מֵאֶחָיו.
English: ‘So that his heart not be lifted above his brethren’ – that he not become arrogant over them.
Derash on humility (Bavli / Sifrei) — the purpose of constant Torah study is to keep the king humble among his people.
The king must remain humble and not elevate his heart above his brethren. Lifelong Torah study is the means to that humility.