For the guidance of mankind, Allah honored four famous Prophets by revealing to them four Holy Books as under:
1) Taurat to Prophet Moses (Musa).
2) Zaboor (Psalms) To Prophet David (Dawood).
3) Injeel (Evangel) To Prophet Jesus (Isa).
4) Quran to Prophet Muhammad (P.B.U.H&H.P).
The commandments of Allah are contained in these books. The first three books were for the earlier times. The Holy Qur'an is the last book of God and is for the guidance of entire mankind till the Day of Judgement.
Prophet Dawood eventually became King of his people. He had 19 sons. Each of them hoped to inherit the father's throne. Allah revealed to Prophet Dawood a few questions and their answers and commanded him to put the questions to each one of his sons. Whosoever answered those questions correctly, would inherit the throne of the father, Prophet David.
One day Prophet David called all his sons in the presence of the scholars and the chiefs of the tribes of his kingdom. He then put forward the following questions:
1. Which thing is closest (nearest) to man?
2. Which is the farthest thing?
3. Which two things are attached to each other?
4. Which is the most awe-creating thing?
5. Which two things remain unchanged?
6. Which two things are always different?
7. Which two things are opposed to each other?
8. What is the action the result of which is good?
9. What is that action the result of which is bad?
The sons of Prophet David felt helpless and could not answer any of these questions. Then the youngest of the sons, Prophet Solomon stood up and gave the following answers:
1. The nearest things to a man is the hereafter (Life and Death - as one may die any moment).
2. The farthest things is the time which has passed away (which is not to come again).
3. The two things that are attached to each other is man's body with the soul.
4. The most awe-creating is the man's body (dead) without soul.
5. The two things which remain the same are the sky and the earth.
6. The two things which are different are the day and night.
7. The two things which are opposed to each other are life and death.
8. The action - the end of which is good - is patience and forbearance at the time of anger.
9. The action - the end of which is bad is haste at the time of anger.
Prophet David obviously, was very much impressed with these correct answers and appointed Prophet Solomon as his successor.
Thus it will be seen that it was the supreme knowledge and understanding that made Prophet Solomon succeed his father and become the Great King Prophet.