"and God said, Ask what I shall give thee" (1 Kings 3:5)
What in the world does that mean? The above scripture, asked of newly made King Solomon in a dream, presents the problem of prayer: God knows what we need, and what we'll ask for, so why pray at all? There are a thousand different answers to this, but in the case of Solomon it appears to be an affirmation that Solomon "loved the LORD" (1Kings3:3). Apparently, Solomon not only loves the Lord, but knows the Lord, otherwise he would not have known what the Lord would want to give him. Also, the verse indicates that whatever Solomon asks, God will give. And that is a pretty big promise, one that the Lord doesn't give easily.
Something similar happens to Nephi in the Book of Helaman 10:5--"And now, because thou hast done this with such unwearyingness, behold, I will bless thee forever; and I will make thee mighty in word and in deed, in faith and in works; yea, even that all things shall be done unto thee according to thy word, for thou shalt not ask that which is contrary to my will."
Both Nephi and Solomon are so close to God, understand Him so well, that they would never ask that which is "contrary" to His will, and therefore God is liberal in His promises to them, and in giving unto them power. Now, what does Solomon ask for? "Give therefore thy servant an understanding heart to judge thy people, that I may discern between good and bad: for who is able to judge this thy so great a people?" (1Kings3:9) Not only does Solomon humbly acknowledge God's covenant people, but admits that they are greater than his powers to rule, and so needs the Lord's help, not to dominate them, but to have an understanding heart of discernment.
If this then is not contrary to God's will, and may be in fact God's will, then might we also assume that that is how God Himself rules? With an understanding heart to discern between the good and the bad? Solomon asked and received. God had to pay a much higher price. The price for an understanding heart was the sacrifice of the Son of God, the atonement of Jesus Christ, that made Him suffer both body and spirit all our afflictions and pains and sins, that He might understand us. And in understanding us, He might become the perfect judge.
Solomon didn't ask to become a good or wise ruler, he asked to become more like Christ. I pray that I too might pray for an understanding heart, but I admit, I don't know if I am willing to pay the price. But I don't think I can afford not to.