Deuteronomy 17:20

20 This will keep him from thinking that he is better than other Israelites and from disobeying the Lord's commands in any way. Then he will reign for many years, and his descendants will rule Israel for many generations.

Deuteronomy 17:20 Meaning and Commentary

Deuteronomy 17:20

That his heart be not lifted up above his brethren
On account of his office, the dignity of it, considering that he was subject to the law of God, and accountable to the Lord for all his actions:

and that he turn not aside from the commandment, to the right hand or
to the left;
not in the least deviate from the law of God in the whole of his conduct, and particularly in the exercise of his kingly office:

to the end that he may prolong his days in his kingdom;
ruling well according to the laws of God being the way to rule long:

he and his children in the midst of Israel;
this shows, as Jarchi observes, that if his son was fit for the kingdom, he was to be preferred to any other man; for though it was elective, yet to be continued in the same family, provided they walked in the ways of the Lord, and observed his laws.

Deuteronomy 17:20 In-Context

18 When he becomes king, he is to have a copy of the book of God's laws and teachings made from the original copy kept by the levitical priests.
19 He is to keep this book near him and read from it all his life, so that he will learn to honor the Lord and to obey faithfully everything that is commanded in it.
20 This will keep him from thinking that he is better than other Israelites and from disobeying the Lord's commands in any way. Then he will reign for many years, and his descendants will rule Israel for many generations.
Scripture taken from the Good News Translation - Second Edition, Copyright 1992 by American Bible Society. Used by Permission.