For although the heart of a given individual is placed in his heart and he has free-choice, the heart of the king is different. Inasmuch as the king's choices affect the greater public, and if he chooses inappropriately, he can negatively impact many, his "heart" is in God's hand, and he is deprived of free will in regards to communal issues.
The school of Rabbi Yishmael taught: What is the meaning of the phrase: If the fallen falls from it? This person was destined to fall from that roof from the six days of Creation, it was ingrained into nature. As, although he did not yet fall, the verse calls him fallen. Nevertheless, the owner of the house is indicted for this, as merit is engendered by means of the innocent and guilt by means of the guilty.
God limits the actions and thoughts of a king...For if a king had pure free will [ regarding communal issues] as he does vis-a-vis his private choices, the nation could be greatly endangered. Therefore, God exercises a certain degree of influence over a king's choices.
The words: "for you are just like Pharaoh" may also be understood in a sense similar to Proverbs 21,1: "the king's heart is in the Lord's hands." This means that the king is privileged to receive divine assistance before pronouncing judgment. If Yehudah were to speak publicly, his advisers would pressure Joseph not to follow his heart's inclination so that ultimately he would not decide according to the will of heaven.
Rabbi Yishmael said: Just as water placed in a container can be tilted in every which way, when a mortal ascends to kingship, his heart is given over to God [who can influence it in many ways]. If the world is meritorious, God will incline the king to issue good decrees, but if the world is found guilty, God will influence him to issue harmful decrees.
The G'd of gods and the Lord of lords, etc." The first statement means that He is the G'd of the angels...The latter expression refers to terrestrial rulers...The reason Moses also had to mention terrestrial rulers is so that we should not think that these rulers are free to do as they please; Moses reminds us that G'd exerts some pressure on those rulers. This is what Solomon meant in Proverbs 21,1: "the heart of the king is in G'd's hand, He directs it to whatever direction He desires."
(ב) רַבָּן גַּמְלִיאֵל בְּנוֹ שֶׁל רַבִּי יְהוּדָה הַנָּשִׂיא אוֹמֵר, יָפֶה תַלְמוּד תּוֹרָה עִם דֶּרֶךְ אֶרֶץ, שֶׁיְּגִיעַת שְׁנֵיהֶם מְשַׁכַּחַת עָוֹן. וְכָל תּוֹרָה שֶׁאֵין עִמָּהּ מְלָאכָה, סוֹפָהּ בְּטֵלָה וְגוֹרֶרֶת עָוֹן. וְכָל הָעֲמֵלִים עִם הַצִּבּוּר, יִהְיוּ עֲמֵלִים עִמָּהֶם לְשֵׁם שָׁמַיִם, שֶׁזְּכוּת אֲבוֹתָם מְסַיַּעְתָּן וְצִדְקָתָם עוֹמֶדֶת לָעַד. וְאַתֶּם, מַעֲלֶה אֲנִי עֲלֵיכֶם שָׂכָר הַרְבֵּה כְּאִלּוּ עֲשִׂיתֶם:
(ג) הֱווּ זְהִירִין בָּרָשׁוּת, שֶׁאֵין מְקָרְבִין לוֹ לָאָדָם אֶלָּא לְצֹרֶךְ עַצְמָן. נִרְאִין כְּאוֹהֲבִין בִּשְׁעַת הֲנָאָתָן, וְאֵין עוֹמְדִין לוֹ לָאָדָם בִּשְׁעַת דָּחְקוֹ:
(2) And all who labor with the community, should labor with them for the sake Heaven, for the merit of their forefathers sustains them (the community), and their (the forefather’s) righteousness endures for ever; And as for you, [God in such case says] I credit you with a rich reward, as if you [yourselves] had [actually] accomplished [it all].
(3) Be careful [in your dealings] with the ruling authorities for they do not befriend a person except for their own needs; they seem like friends when it is to their own interest, but they do not stand by a man in the hour of his distress.
(ב) רַבִּי חֲנִינָא סְגַן הַכֹּהֲנִים אוֹמֵר, הֱוֵי מִתְפַּלֵּל בִּשְׁלוֹמָהּ שֶׁל מַלְכוּת, שֶׁאִלְמָלֵא מוֹרָאָהּ, אִישׁ אֶת רֵעֵהוּ חַיִּים בְּלָעוֹ.
(2) Rabbi Hanina, the vice-high priest said: pray for the welfare of the government, for were it not for the fear it inspires, every man would swallow his neighbor alive.
Rav Yehuda said in the name of Rav: Three matters require a plea for mercy to bring them about: A good king, a good year, and a good dream. A good king, as it is written: “The king’s heart is in the hand of the Lord as the watercourses: He turns it whithersoever He will” (Proverbs 21:1)...
(א) מִצְוַת עֲשֵׂה לִתֵּן צְדָקָה לָעֲנִיִּים כְּפִי מַה שֶּׁרָאוּי לֶעָנִי. אִם הָיְתָה יַד הַנּוֹתֵן מַשֶּׂגֶת. שֶׁנֶּאֱמַר (דברים טו ח) "פָתֹחַ תִּפְתַּח אֶת יָדְךָ לוֹ" וְנֶאֱמַר (ויקרא כה לה) "וְהֶחֱזַקְתָּ בּוֹ גֵּר וְתוֹשָׁב וָחַי עִמָּךְ" וְנֶאֱמַר (ויקרא כה לו) "וְחֵי אָחִיךָ עִמָּךְ":
(1) It is a positive mitzvah to give tzedakah to the poor according to what is fitting for the poor person if he has the means to do so, as it is said, (Deut. 15:8) Rather, you must open your hand and lend him sufficient for whatever he needs. And it is said, (Lev. 25:35) [If your kinsman, being in straits, comes under your authority,] and you hold him as though a resident alien, [let him live by your side:] And it is said (Lev. 25:36), [Do not exact from him advance or accrued interest, but fear your God.] Let him live by your side as your kinsman.130See Babylonian Talmud Ketubot 67b-68a.
(יג) עָנִי שֶׁהוּא קְרוֹבוֹ קֹדֶם לְכָל אָדָם. עֲנִיֵּי בֵּיתוֹ קוֹדְמִין לַעֲנִיֵּי עִירוֹ. עֲנִיֵּי עִירוֹ קוֹדְמִין לַעֲנִיֵּי עִיר אַחֶרֶת. שֶׁנֶּאֱמַר (דברים טו יא) "לְאָחִיךָ לַעֲנִיֶּךָ וּלְאֶבְיֹנְךָ בְּאַרְצֶךָ":
(13) A poor person who is a relative takes precedence over anyone else. The poor of one's household take precedence over the poor of one's city. The poor of one's city take precedence over the poor of another city, as it is said, (Deut. 15:11) Open your hand to the poor and needy kinsman in your land.
§ The Gemara raises a contradiction between this statement of Rabbi Yosei and another statement of Rabbi Yosei. It was taught in a baraita: In the case of a spring belonging to the residents of a city, if the water was needed for their own lives, i.e., the city’s residents required the spring for drinking water, and it was also needed for the lives of others, their own lives take precedence over the lives of others. Likewise, if the water was needed for their own animals and also for the animals of others, their own animals take precedence over the animals of others. And if the water was needed for their own laundry and also for the laundry of others, their own laundry takes precedence over the laundry of others. However, if the spring water was needed for the lives of others and their own laundry, the lives of others take precedence over their own laundry. Rabbi Yosei disagrees and says: Even their own laundry takes precedence over the lives of others, as the wearing of unlaundered clothes can eventually cause suffering and pose a danger.
(ז) נִתַּאי הָאַרְבֵּלִי אוֹמֵר, הַרְחֵק מִשָּׁכֵן רָע, וְאַל תִּתְחַבֵּר לָרָשָׁע, וְאַל תִּתְיָאֵשׁ מִן הַפֻּרְעָנוּת:
(7) Nittai the Arbelite used to say: keep a distance from an evil neighbor, do not become attached to the wicked, and do not abandon faith in [divine] retribution.
(א) דֶרֶךְ בְּרִיָּתוֹ שֶׁל אָדָם לִהְיוֹת נִמְשָׁךְ בְּדֵעוֹתָיו וּבְמַעֲשָׂיו אַחַר רֵעָיו וַחֲבֵרָיו וְנוֹהֵג כְּמִנְהַג אַנְשֵׁי מְדִינָתוֹ. לְפִיכָךְ צָרִיךְ אָדָם לְהִתְחַבֵּר לַצַּדִּיקִים וִלֵישֵׁב אֵצֵל הַחֲכָמִים תָּמִיד כִּדֵי שֵׁיִּלִמֹד מִמַּעֲשֵׂיהֵם. וִיִתִרַחֵק מִן הָרִשָׁעִים הַהוֹלְכִים בַּחשֶׁךְ כְּדֵי שֶׁלֹּא יִלְמֹד מִמַּעֲשֵׂיהֶם. הוּא שֶׁשְּׁלֹמֹה אוֹמֵר (משלי יג כ) "הוֹלֵךְ אֶת חֲכָמִים יֶחְכָּם וְרֹעֶה כְסִילִים יֵרוֹעַ". וְאוֹמֵר אַשְׁרֵי הָאִישׁ וְגוֹ'. וְכֵן אִם הָיָה בִּמְדִינָה שֶׁמִּנְהֲגוֹתֶיהָ רָעִים וְאֵין אֲנָשֶׁיהָ הוֹלְכִים בְּדֶרֶךְ יְשָׁרָה יֵלֵךְ לְמָקוֹם שֶׁאֲנָשֶׁיהָ צַדִּיקִים וְנוֹהֲגִים בְּדֶרֶךְ טוֹבִים. וְאִם הָיוּ כָּל הַמְּדִינוֹת שֶׁהוּא יוֹדְעָם וְשׁוֹמֵעַ שְׁמוּעָתָן נוֹהֲגִים בְּדֶרֶךְ לֹא טוֹבָה כְּמוֹ זְמַנֵּנוּ. אוֹ שֶׁאֵינוֹ יָכוֹל לָלֶכֶת לִמְדִינָה שֶׁמִּנְהֲגוֹתֶיהָ טוֹבִים מִפְּנֵי הַגְּיָסוֹת אוֹ מִפְּנֵי הַחֹלִי יֵשֵׁב לְבַדּוֹ יְחִידִי כָּעִנְיָן שֶׁנֶּאֱמַר (איכה ג כח) "יֵשֵׁב בָּדָד וְיִדֹּם". וְאִם הָיוּ רָעִים וְחַטָּאִים שֶׁאֵין מְנִיחִים אוֹתוֹ לֵישֵׁב בַּמְּדִינָה אֶלָּא אִם כֵּן נִתְעָרֵב עִמָּהֶן וְנוֹהֵג בְּמִנְהָגָם הָרַע יֵצֵא לַמְּעָרוֹת וְלַחֲוָחִים וְלַמִּדְבָּרוֹת. וְאַל יַנְהִיג עַצְמוֹ בְּדֶרֶךְ חַטָּאִים כָּעִנְיָן שֶׁנֶּאֱמַר (ירמיה ט א) "מִי יִתְּנֵנִי בַמִּדְבָּר מְלוֹן אֹרְחִים":
(1) It is a natural tendency of man to be influenced in his ideas and conduct by his fellows and associates, and to follow the usage of the people of his state. Because thereof, it is necessary for man to be in the company of the righteous, and to sit near the wise, in order to learn from their conduct, and to distance himself from the evil-doers who follow the path of darkness, in order not to learn from their conduct...Likewise, if a man be in a state where evil customs prevail and where the people are not following the righteous ways, he should go to a place where the inhabitants are righteous and follow the way of the good. If all the states known to him, or of which intelligence reached him, be followers of a path which is not good, as it is in our own times, or if he be unable to migrate to a state whose rules of conduct are good, either on account of military operations or on account of sickness, he should isolate himself and live in seclusion, even as it is said on the subject: "Let him sit alone and keep silence" (Lam. 3.28). And, if the inhabitants of his state be evildoers and sinners, who deny him the right of residence in the state unless he become assimilated with them, and follows their evil conduct, he should go forth and dwell in caves, or cliffs, or deserts, but not accustom himself in the way of the sinners...
(1) When David’s life was drawing to a close, he instructed his son Solomon as follows... (5) “Further, you know what Joab son of Zeruiah did to me, what he did to the two commanders of Israel’s forces, Abner son of Ner and Amasa son of Jether: he killed them, shedding blood of war in peacetime, staining the girdle of his loins and the sandals on his feet with blood of war. (6) So act in accordance with your wisdom, and see that his white hair does not go down to the grave in peace.
ואינו יוצא לא לעדות מצוה ולא לעדות ממון ולא לעדות נפשות ואפי' ישראל צריכים לו ואפי' שר צבא ישראל כיואב בן צרויה אינו יוצא משם לעולם שנאמר (במדבר לה, כה) אשר נס שמה שם תהא דירתו שם תהא מיתתו שם תהא קבורתו
And one who is exiled may not leave the city at all, either for testimony relating to a mitzva, or for testimony relating to monetary matters, or for testimony relating to capital matters. And even if the Jewish people require his services, and even if he is the general of the army of Israel like Joab ben Zeruiah, he never leaves...