from Mishlei (editor).
פלגי מים לב מלך ביד ה' על כל אשר יחפץ יטנו
The heart of a king is like streams of water in the hand of Hashem; wherever He wishes, so does He direct it.
Since the decisions of a king affect the masses, it would be dangerous if he were to wield absolute power. Thus, Hashem controls the actions of kings so that they do not possess free will in regard to matters of public policy (Malbim). That being the case, people should fear and obey Hashem, not the monarch (Rabbeinu Yonah).
Such Divine intervention is explicitly referred to in the case of Absalom’s rebellion against his father, David. After consulting with the brilliant adviser, Ahithopel, Absalom asked the opinion of Hushai as well, who—unbeknownst to Absalom—was a spy for David. Although Ahithopel’s advice was clearly superior, Hashem caused Absalom to listen to Hushai, in order to bring about his downfall (II Samuel 17:14).
Throughout history, Hashem has used powerful tyrants as the “rod of His wrath” (Isaiah 10:5) to punish the nation of Israel. Nevertheless, these gentile leaders are held accountable for their deeds (see ibid. 10:12-14), as was the case with Pharaoh.
פלגי מים--Like streams of water.
Just as man has the power to direct the flow of a river via canals and dams, so does Hashem direct a king’s actions that affect his subjects (Metsudos, Malbim). The root of פלגי--streams of—is פלג--divides. Just as the water is divided into separate streams, so are the king’s actions divided into reward and punishment (Maharsha, Berachos 55a).
לב מלך ביד ה'--Is the heart of a king in the hand of Hashem.
This refers not only to a king, but to any figure of authority, such as a judge (Ralbag; see Exodus 23:7).
According to Resisai Layla, the water in this verse is a reference to Torah, and the king represents Torah scholars (see Gittin 62a). Hashem places ideas in the minds of Torah sages, which become the basis for their halachic rulings. At times, Hashem inserts different thoughts in the minds of different scholars, setting the stage for a Torah dispute. This explains the concept of אלו ואלו דברי אלקים חיים—“Both opinions represent the words of the Living G-d” (Gittin 6b; see also Vilna Gaon).
However, Sefer Chasidim (173) understands this verse as referring to all people. No one should take credit for refraining from sin, because a person’s heart is in the hand of Hashem, Who orchestrates every individual’s victory against his evil inclination.
על כל אשר יחפוץ יטנו--Wherever He wishes, so does He direct it.
Meiri explains the word יטנו--direct it--as applying not to G-d but to the king—wherever G-d directs, the king must turn his heart. Although this concept applies to all people, the verse speaks specifically about a king, since a monarch is particularly
susceptible to arrogant narcissism (Meiri), or because he has the power and resources to carry out Hashem’s will with a minimum of obstacles.
The Vilna Gaon interprets this verse inversely. Once a man makes a decision as to what he desires, Hashem guides him in that direction. This echoes the Talmudic concept that בדרך שאדם רוצה לילך מוליכים אותו —“A man is led in the direction that he chooses to go” (Maccos 10b; see above 3:34).
 When Moses was commanded to appear before Pharaoh, he expressed two reservations. One was that if the Jewish people didn’t believe that he would redeem them, then surely Pharaoh wouldn’t either. The second was that he had a speech defect
(Exodus 6:12). Somewhat later, Moses mentioned only his second reservation, which implies that he had retracted the first (v. 30; see Rashi). Meshech Chochmah explains that after Moses made his first statement, Hashem said, אני ה' --I am Hashem (ibid. 29)—meaning, “Since the decisions of kings are not in their own hands but in Mine, you need not be concerned about Pharaoh’s belief or consent.”
 Our history is replete with incidents in which gentile leaders have made decisions completely uncharacteristic of them, sometimes miraculously relinquishing their malign intent against the Jews and even acting on their behalf.
Rav Chaim Leib Auerbach (father of Rav Shlomo Zalman Auerbach) lived during the era of Turkish rule over the land of Israel. The Turks were generally anti-Semitic and during the first World War often drafted Jewish soldiers and sent them to the battlefront, from which many did not return.
The Turks did not draft immigrants, and so Rav Auerbach befriended the Iranian ambassador, who eventually appointed him to an executive position in the Iranian consulate. There, he was able to process Iranian passports for seventy Jews, thus saving their lives.
However, his activities were reported to the Turkish authorities, who put him on trial for his life.
When Rav Auerbach argued that the Jews to whom he had issued passports were genuine Iranian citizens, the Turkish governor, Jamal Pasha, grew furious with him and began to scream, “Liar! How can you tell me that they are Iranians? They are all white-skinned, while Iranians are dark!” Rav Auerbach didn’t get flustered, but simply responded, “Your honor, you are surely aware that the Russian pigs”—he used this expression because the Russians were at war with the Turks—“cause many problems for Russian Jews. Thus, when a Jewish women is about to give birth, she crosses the border into Iran and has her baby there, so that it will be an Iranian citizen. It is to these children that I issued passports.” Jamal Pasha answered, “I know that you’re a liar, but it would be a shame to puta man with such a mind to death. Now leave!”
 This concept is discussed extensively by many commentators. See, for example, Michtav MeEliyahu, Vol. II, pg. 235, and Sifsei Chaim, Vol. Emunah VeHashgachah on Gezeirah U’Bechirah.