Solomon’s wisdom was supernatural. His request for an understanding heart (1 Kings 3:9) was not about seeing things from a human perspective, but about seeing things from God’s perspective. Solomon’s wisdom enabled him to discern between good and evil and gave him experience in Divine things (2449). As a result of this understanding, it says in 2 Chronicles 8:11 that “Solomon brought up the daughter of Pharaoh out of the city of David unto the house that he built for her; for he said, My wife shall not dwell in the house of David king of Israel, because the places are holy whereunto the ark of the LORD hath come.”
Solomon’s solution of building a separate residence for his foreign wife was a compromise. Solomon didn’t want his marriage to interfere with God’s blessing on the nation of Israel, nor did he want to jeopardize his alliance with Pharaoh, so he came up with a solution that would keep everyone happy. In addition to his discernment of good and evil, Solomon also had prudence in secular matters. He was able to adapt what he knew to what he ought to do in any given situation.
The problem with Solomon’s compromise was it opened the door to secular worship practices in Israel. Solomon’s wife did not convert to Judaism, but remained an Egyptian both culturally and spiritually. She was afforded the luxury of living in God’s holy city without becoming holy herself. An example of this today is the person that goes to church every week, but never becomes a Christian. Solomon’s Egyptian wife never experienced conversion.