One of the qualities most ascribed to Solomon is his wisdom. Solomon prays:
"Give Thy servant an understanding heart to judge Thy people and to know good and evil."1 Kings 3:9 
"So God said to him, "Since you have asked for this and not for long life or wealth for yourself, nor have asked for the death of your enemies but for discernment in administering justice, I will do what you have asked..."" (1 Kings 3:11-12) The Bible also states that: "The whole world sought audience with Solomon to hear the wisdom God had put in his heart." (1 Kings 10:24)
One account, known as the Judgment of Solomon, has two mothers who came before Solomon to resolve a quarrel about which was the true mother of a baby. (The other's baby died in the night and each claims the surviving child as hers.) When Solomon suggests dividing the living child in two with a sword, the true mother is revealed to him because she is willing to give up her child to the lying woman rather than have the child killed. Solomon then declares the woman who shows the compassion is the true mother, and gives the baby back to her.