"The King's heart is like channels of water in the hand of the Lord. He turns it wherever He wishes"
There are a number of observations to make here.
the King's heart
It is the leader's mind that is being discussed. We must understand that God can redirect the thinking of a leader anytime one of his larger purposes will be served by that redirection. It is a great comfort to realize that when my purposes line up with God's, then He is able to move those in authority over me to do things that they may not have been inclined to do before.
When I am the leader that is in question, I must realize that God is moving me to a place of recognizing His direction and His purpose. It is not by accident that we hear the things that we hear or see the things that we see. He really is able to give me the desires that He wants me to have. Psalm 37:4
I hope and pray that my children understand that they will not always get their way but when their plans, prayers, and actions line up with God, then He is able to change the thinking of their parents, government officials, husbands, and whoever is legitimately in authority over them.
Underneath the fabric of this text is the sovereignty of God – that wonderful truth that assures us that God has not lost control of the universe. Notice that the flow of the king was in a certain direction, but it did not line up with God's direction so God changes the way the leader thinks. There is something bigger than your getting your own way; there is the plan and purpose of God. The sovereignty of God allows for freedom and creativity within the purpose and plan of God; but if your freedom will damage or destroy the larger purpose of God, He will control your choices and even your heart. What is fascinating – and at the same time difficult – is that God declares that He does mess with the leader's thoughts and emotions which is the equivalent of heart.
One of the larger questions is will we cooperate with the movement of God on our soul or will we fulfill the Lord's will from the negative position like Sampson? God was constantly directing Sampson as the leader, but it was through his sinfulness and Sampson had no joy or enjoyment of the victories that he won. David, on the other hand, was one who was tender to the Lord and when He was directed he stayed righteous and enjoyed the path that God had for him.
God has selected a path for each one of my children. If they adapt themselves to the pathway of God in righteousness in this life, they will have its share of joys and love. If they seek to find their own path outside of the will of God and righteousness, they will end up fulfilling His purposes but will not enjoy the journey.
One of the things I count on is that if I am going in the wrong direction, God will direct me like a channel of water to the right direction even though it may take me a while to catch up with the joy or reason for that change.
He turns it wherever He wishes
The phrase He turns it wherever He wishes could also accurately be translated He inclines it wherever He delights. The question becomes is it possible to rebel against this inclination that the Lord puts on our heart? While different theological camps have argued this one, it is the most helpful to look at this practically. Do not rebel against the inclination of the Lord even though parts of your being do not want what He is leaning you toward. You will have a miserable time fighting against God and end up fulfilling His purpose anyway.
The next verse would suggest that it is possible to rebel from the inclination that God puts on the heart for it states that God weighs hearts or judges them. It is not possible to judge or weigh hearts if the person has no say in what the heart becomes.
This suggest that we have the opportunity to develop our souls into wonderfully developed places where God and His inclinations are welcome or we can reject the inclinations of God as pious goody, goody impulses that should be ignored in a sinful world. The Bible is a whole book about the development of the soul and its effect on your life. If you give in to selfishness, then you get a shrunken negative soul. If you give in or follow God's inclination, then you enjoy an enlarged soul and the power and blessings of God in spite of what your outward circumstances may be.