7כְּשֶׁמַּעֲמִידִין הַמֶּלֶךְ מוֹשְׁחִין אוֹתוֹ בְּשֶׁמֶן הַמִּשְׁחָה. שֶׁנֶּאֱמַר (שמואל א י א) "וַיִּקַּח שְׁמוּאֵל אֶת פַּךְ הַשֶּׁמֶן וַיִּצֹק עַל רֹאשׁוֹ וַיִּשָּׁקֵהוּ". וּמֵאַחַר שֶׁמּוֹשְׁחִין הַמֶּלֶךְ הֲרֵי זֶה זוֹכֶה לוֹ וּלְבָנָיו עַד עוֹלָם. שֶׁהַמַּלְכוּת יְרֻשָּׁה שֶׁנֶּאֱמַר (דברים יז כ) "לְמַעַן יַאֲרִיךְ יָמִים עַל מַמְלַכְתּוֹ הוּא וּבָנָיו בְּקֶרֶב יִשְׂרָאֵל". הֵנִיחַ בֵּן קָטָן מְשַׁמְּרִין לוֹ הַמְּלוּכָה עַד שֶׁיַּגְדִּיל. כְּמוֹ שֶׁעָשָׂה יְהוֹיָדָע לְיוֹאָשׁ. וְכָל הַקּוֹדֵם בְּנַחֲלָה קֹדֶם לִירֻשַּׁת הַמְּלוּכָה. וְהַבֵּן הַגָּדוֹל קוֹדֵם לְקָטָן מִמֶּנּוּ. וְלֹא הַמַּלְכוּת בִּלְבַד אֶלָּא כָּל הַשְּׂרָרוֹת וְכָל הַמִּנּוּיִין שֶׁבְּיִשְׂרָאֵל יְרֻשָּׁה לִבְנוֹ וּלְבֶן בְּנוֹ עַד עוֹלָם. וְהוּא שֶׁיִּהְיֶה הַבֵּן מְמַלֵּא מְקוֹם אֲבוֹתָיו בְּחָכְמָה וּבְיִרְאָה. הָיָה מְמַלֵּא בְּיִרְאָה אַף עַל פִּי שֶׁאֵינוֹ מְמַלֵּא בְּחָכְמָה מַעֲמִידִין אוֹתוֹ בִּמְקוֹם אָבִיו וּמְלַמְּדִין אוֹתוֹ. וְכָל מִי שֶׁאֵין בּוֹ יִרְאַת שָׁמַיִם אַף עַל פִּי שֶׁחָכְמָתוֹ מְרֻבָּה אֵין מְמַנִּין אוֹתוֹ לְמִנּוּי מִן הַמִּנּוּיִין שֶׁבְּיִשְׂרָאֵל. כֵּיוָן שֶׁנִּמְשַׁח דָּוִד זָכָה בְּכֶתֶר מַלְכוּת. וַהֲרֵי הַמַּלְכוּת לוֹ וּלְבָנָיו הַזְּכָרִים עַד עוֹלָם. שֶׁנֶּאֱמַר (שמואל ב ז טז) "כִּסְאֲךָ יִהְיֶה נָכוֹן עַד עוֹלָם". וְלֹא זָכָה אֶלָּא לִכְשֵׁרִים שֶׁנֶּאֱמַר (תהילים קלב יב) "אִם יִשְׁמְרוּ בָנֶיךָ בְּרִיתִי". אַף עַל פִּי שֶׁלֹּא זָכָה אֶלָּא לִכְשֵׁרִים לֹא תִכָּרֵת הַמְּלוּכָה מִזֶּרַע דָּוִד לְעוֹלָם. הַקָּדוֹשׁ בָּרוּךְ הוּא הִבְטִיחוֹ בְּכָךְ שֶׁנֶּאֱמַר (תהילים פט לא) "אִם יַעַזְבוּ בָנָיו תּוֹרָתִי וּבְמִשְׁפָּטַי לֹא יֵלֵכוּן" (תהילים פט לג) "וּפָקַדְתִּי בְשֵׁבֶט פִּשְׁעָם וּבִנְגָעִים עֲוֹנָם" (תהילים פט לד) "וְחַסְדִּי לֹא אָפִיר מֵעִמּוֹ":
When a king is appointed, he is anointed with oil reserved for this purpose, as I Samuel 10:1 states: 'And Samuel took the cruse of oil and poured it over his head. Then, he kissed him.' Once a king is anointed, he and his descendents are granted the monarchy until eternity, for the monarchy is passed down by inheritance, as Deuteronomy 17:20 states 'Thus, he the king and his descendents will prolong their reign in the midst of Israel.' If the king leaves only a young son, the monarchy should be held for him until he matures, as Yehoyada did for Yoash. The order of inheritance of the monarchy is the same as that governing the inheritance of property. An older son is given precedence over a younger one. Not only the monarchy, but all other positions of authority and appointments in Israel, are transferred to one's children and grandchildren as inheritances forever. The above applies if the knowledge and the fear of G-d of the son is equivalent to that of his ancestors. If his fear of G-d is equivalent to theirs but not his knowledge, he should be granted his father's position and given instruction. However, under no circumstance should a person who lacks the fear of G-d be appointed to any position in Israel, even though he possesses much knowledge. Once David was anointed king, he acquired the crown of kingship. Afterwards, the kingship belonged to him and to his male descendents forever, as II Samuel 7: 16 states: 'Your throne shall be established forever.' Nevertheless, his acquisition of the monarchy was conditional, applying only to the righteous among his descendents, as Psalms 132:12 states: 'If your children will keep My covenant... their children shall also sit on your throne forever.' Despite this condition, G-d assured David that the monarchy would never be taken from his descendents forever, as Psalms 89:31-38 states: "lf his children will forsake My Torah and cease walking in My statutes ... I will punish their transgressions with the rod and their sins with plagues. Nevertheless, I will not utterly remove My grace from him.... His throne shall be ... established forever.'