(Devarim 17:19) "And it shall be with him": From here they ruled: When the king goes out to war, it is with him. When he presides in judgment, it is by him. When he sits down, it is beside him.
"so that he learn to fear the L-rd his G-d": We are hereby taught that study leads to fear; fear to heeding, heeding, to doing. Because we find that a commoner is like a king vis-à-vis words of Torah, we might think he is like him in other things, (too); it is, therefore, written "to heed all the words of this Torah and these statutes": He is like him in respect to words of Torah, but not in respect to other things,
whence it was ruled: A king breaches (the fence of others) to make way for himself (to go to his vineyard or his field), and he may not be held back (from doing so). He may broaden roads for himself, and he is not held back from doing so. The path of the king has no limits. And all of the people take of the spoil and place it before him, and he takes the prime portion. (He chooses first and takes half of all the spoil.)
(דברים יז יט) וְהָיְתָה עִמּוֹ וְקָרָא בוֹ כָּל יְמֵי חַיָּיו, מִכָּן אָמְרוּ (סנהדרין ב ד): הַמֶּלֶךְ יוֹצֵא לַמִּלְחָמָה וְהוּא עִמּוֹ, נִכְנָס וְהוּא עִמּוֹ, יוֹשֵׁב בַּדִּין וְהוּא אֶצְלוֹ, מֵסֵב וְהוּא כְּנֶגְדּוֹ, שֶׁנֶּאֱמַר וְהָיְתָה עִמּוֹ וְקָרָא בוֹ כָּל יְמֵי חַיָּיו.
(Devarim 17:19) "And it shall be with him": From here they ruled: When the king goes out to war, it is with him. When he presides in judgment, it is by him. When he sits down, it is beside him.
יְמֵי חַיָּיו – הַיָּמִים, כָּל יְמֵי חַיָּיו – הַלֵּילוֹת.
"and he shall read in it all the days of his life": "the days of his life": the days; "all the days of his life": the nights.
לְמַעַן יִלְמַד לְיִרְאָה אֶת ה׳ אֱלֹהָיו, מְלַמֵּד שֶׁהַמּוֹרָא מֵבִיא לִידֵי מִקְרָא, מִקְרָא מֵבִיא לִידֵי תַּרְגּוּם, תַּרְגּוּם מֵבִיא לִידֵי מִשְׁנָה, מִשְׁנָה מְבִיאָה לִידֵי תַּלְמוּד, תַּלְמוּד מֵבִיא לִידֵי מַעֲשֶׂה, מַעֲשֶׂה מֵבִיא לִידֵי יִרְאָה. לְפִי שֶׁמָּצִינוּ שֶׁשָּׁוֶה הֶדְיוֹט לַמֶּלֶךְ בְּדִבְרֵי תוֹרָה, יִשְׁוֶה לוֹ בִּדְבָרִים אֲחֵרִים? תַּלְמוּד לוֹמַר: לִשְׁמֹר אֶת כָּל דִּבְרֵי הַתּוֹרָה הַזֹּאת, לְדִבְרֵי תוֹרָה שָׁוֶה לוֹ, וְאֵין שָׁוֶה לוֹ לִדְבָרִים אֲחֵרִים.
"so that he learn to fear the L-rd his G-d": We are hereby taught that study leads to fear; fear to heeding, heeding, to doing. Because we find that a commoner is like a king vis-à-vis words of Torah, we might think he is like him in other things, (too); it is, therefore, written "to heed all the words of this Torah and these statutes": He is like him in respect to words of Torah, but not in respect to other things,
מִכָּן אָמְרוּ (סנהדרין פ״ב מ״ד): מֶלֶךְ פּוֹרֵץ לַעֲשׂוֹת לוֹ דֶרֶךְ – וְאֵין מְמַחִים בְּיָדוֹ, לְהַרְחִיב לוֹ סְטְרַטְיָאוֹת – וְאֵין מְמַחִים בְּיָדוֹ. דֶּרֶךְ הַמֶּלֶךְ – אֵין לוֹ שִׁיעוּר, וְכָל הָעָם בּוֹזְזִים וְנוֹתְנִים לְפָנָיו וְהוּא נוֹטֵל חֵלֶק בָּרֹאשׁ.
whence it was ruled: A king breaches (the fence of others) to make way for himself (to go to his vineyard or his field), and he may not be held back (from doing so). He may broaden roads for himself, and he is not held back from doing so. The path of the king has no limits. And all of the people take of the spoil and place it before him, and he takes the prime portion. (He chooses first and takes half of all the spoil.)
דָּבָר אַחֵר: וְאֶת הַחֻקִּים הָאֵלֶּה – אֵלֶּה חֻקֵּי מַלְכוּת.