1 Kings 10:24

And all the earth sought to Solomon, to hear his wisdom, which God had put in his heart.

The wisdom in Solomon's heart was put there by God in answer to his youthful seeking of divine guidance, when he chose an understanding heart above earthly riches, honor, and long life, and it made him the wisest king ever to sit upon a throne. That wisdom was displayed in many proverbs and songs, in directing every important enterprise, in managing the business of the kingdom with the greatest wisdom, and in faithfully carrying out the directions for building the temple unmatched for richness, beauty, and costly design. For many years his life was marked with devotion to God, uprightness, firm principle, and strict obedience to God's commands, and he was greatly blessed and honored of God.

His faithful work and God-given wisdom and power made him famous throughout the world and astonished the nations, which acknowledged and marveled at his superior knowledge and wisdom, the excellence of his character, and the greatness of his power. People from across the earth and from many lands and all parts of the world came to Solomon to hear the wisdom God had put in his heart, to behold his power, and to be instructed by him how to conduct difficult matters.

For a time he directed the admiration of his visitors away from himself to the Creator and Ruler of the universe, so that Jehovah's name was honored and His temple was treated with reverence. His later surrender to lustful passion led him away from God, the source of his strength, and into lust and idolatry, showing that his early wisdom and its gift and influence did not protect or preserve him when he abandoned principle and turned from God.