"The king's heart is like channels of water in the hand of the LORD; He turns it wherever He desires" (Proverbs 21:1). Rabbi Yishmael says: Channels of water in the hand of the LORD. Just as this water, when you put it into a vessel you turn it to any side you wish, so when a mortal of flesh and blood rises to kingship, his heart is placed in the hand of the Holy One, blessed be He. If the world is worthy, the Holy One, blessed be He, turns the heart of the king to good decrees; but if the world is found guilty, the Holy One, blessed be He, turns his heart to evil decrees. And every single decree that he issues from his mouth does not go out at the start except from before the Holy One, blessed be He. And therefore it is said, "He turns it wherever He desires."
The King's Heart Is Like Channels of Water in God's Hand
Midrash Mishlei 21:1
(משלי כא א): "פלגי מים לב מלך ביד ה', על כל אשר יחפוץ יטנו" - רבי ישמעאל אומר: פלגי מים ביד ה' - מה המים הללו, כשאתה נותנן בכלי אתה מטה אותן לכל צד שאתה רוצה, כך כשבשר ודם עולה למלוכה, ליבו נתון ביד הקב"ה; אם זכה העולם, הקב"ה מטה ליבו של מלך לגזירות טובות, אבל אם נתחייב העולם, הקב"ה מטה ליבו לגזירות רעות, וכל גזירה וגזירה שיוציא מפיו אינה יוצאה בתחילה, אלא מלפני הקב"ה, ולכך נאמר "על כל אשר יחפוץ יטנו".