1 Kings 11:4 (NKJV)
For it was so, when Solomon was old, that his wives turned his heart after other gods; and his heart was not loyal to the Lord his God, as was the heart of his father David.
King Solomon had asked for wisdom and God had made him the wisest man the world has ever seen. Human wisdom will mislead you when it goes against God's wisdom. It is hard to fathom that after starting so well, Solomon ended so pitifully. The difference between David and Solomon was that of trust. David sinned many times and yet always returned to God with a broken heart and a contrite spirit. David's own intellectual abilities did not get in the way of his trust in the Lord. Solomon sinned and reasoned in his mind that he could handle it. That was his fatal mistake.
However great our strengths, if we rely on them rather than on God, we will be sure to fall. David, the emotional man, loved God with all his heart. Solomon, the intellectual, loved God only with his mind.
1 Corinthians 10:12 (NKJV)
Therefore let him who thinks he stands take heed lest he fall.