2 Samuel 8:15
“Thus David reigned over all Israel and administered justice and righteousness for all his people.”
While this wasn't the most prosperous time in Israel's history, it may have been the best and most innocent. The people had Saul not so many years ago. He fulfilled many of the problems God had warned them about. He was corrupt and self serving. He took the sons and daughter of the people and they became soldiers and servants of the realm. They were overtaxed of their wealth and goods.
Saul had early on become a bad example of faith in God. He didn't respect the office of the priests and obeyed only the parts that interested him. He was a respecter of people instead of a lover of God. So, the people didn't have a national faith leader.
David was the opposite on almost every measure. He respected God. The people learned to trust Him for that reason. His conscience as well as the prophet would remind him when he strayed from God's ways. He would alter his errors upon correction.
God blessed the nation with peace as they served Him. Most of their enemies were either conquered or at peace with them.
Having a godly, just leader is as good as it gets. The only better one will be in the millennial reign when Jesus rules for a 1,000 years over the earth. The kingdom of God will be among us. When a ruler fears God and administers justice there is peace.
God does control all leaders. We will reap what we sow. If the people don't follow God and do evil, then evil rulers take charge. We are getting what we deserve. In spite of this God still rules. Proverbs 21:1 says, "The king’s heart is like channels of water in the hand of the LORD; He turns it wherever He pleases." This doesn't mean all they do is godly. We sowed evil, so evil will be what they do. God does still do things He will through them.
Lord, thank You for David and his example. Thank You for good, godly leaders who lead well. Thank You that You control all leaders.