1The queen of Sheba heard of Solomon’s fame, through the name of the Lord, and she came to test him with hard questions. 2She arrived in Jerusalem with a very large retinue, with camels bearing spices, a great quantity of gold, and precious stones. When she came to Solomon, she asked him all that she had in mind. 3Solomon had answers for all her questions; there was nothing that the king did not know, [nothing] to which he could not give her an answer. 4When the queen of Sheba observed all of Solomon’s wisdom, and the palace he had built, 5the fare of his table, the seating of his courtiers, the service and attire of his attendants, and his wine service, and the burnt offerings that he offered at the House of the Lord, she was left breathless.
6She said to the king, “The report I heard in my own land about you and your wisdom was true. 7But I did not believe the reports until I came and saw with my own eyes that not even the half had been told me; your wisdom and wealth surpass the reports that I heard. 8How fortunate are your men and how fortunate are these your courtiers, who are always in attendance on you and can hear your wisdom! 9Praised be the Lord your God, who delighted in you and set you on the throne of Israel. It is because of the Lord’s everlasting love for Israel that He made you king to administer justice and righteousness.” 1 Kings 10/1-9 Tanakh JPS 1985.
9The Lord was angry with Solomon, because his heart turned away from the Lord, the God of Israel, who had appeared to him twice 10and had commanded him about this matter, not to follow other gods; he did not obey what the Lord had commanded. 11And the Lord said to Solomon, “Because you are guilty of this—you have not kept My covenant and the laws which I enjoined upon you—I will tear the kingdom away from you and give it to one of your servants. 12But, for the sake of your father David, I will not do it in your lifetime; I will tear it away from your son. 13However, I will not tear away the whole kingdom; I will give your son one tribe, for the sake of My servant David and for the sake of Jerusalem which I have chosen.” 1 Kings 11/9-13 Tanakh JPS 1985.
26Jeroboam son of Nebat, an Ephraimite of Zeredah, the son of a widow whose name was Zeruah, was in Solomon’s service; he raised his hand against the king. 27The circumstances under which he raised his hand against the king were as follows: Solomon built the Millo and repaired the breach of the city of his father, David. 28This Jeroboam was an able man, and when Solomon saw that the young man was a capable worker, he appointed him over all the forced labor of the House of Joseph.
29During that time Jeroboam went out of Jerusalem and the prophet Ahijah of Shiloh met him on the way. He had put on a new robe; and when the two were alone in the open country, 30Ahijah took hold of the new robe he was wearing and tore it into twelve pieces. 31“Take ten pieces,” he said to Jeroboam. “For thus said the Lord, the God of Israel: I am about to tear the kingdom out of Solomon’s hands, and I will give you ten tribes. 32But one tribe shall remain his—for the sake of My servant David and for the sake of Jerusalem, the city that I have chosen out of all the tribes of Israel. 33For they have forsaken Me; they have worshiped Ashtoreth the goddess of the Phoenicians, Chemosh the god of Moab, and Milcom the god of the Ammonites; they have not walked in My ways, or done what is pleasing to Me, or [kept] My laws and rules, as his father David did. 34However, I will not take the entire kingdom away from him, but will keep him as ruler as long as he lives for the sake of My servant David whom I chose, and who kept My commandments and My laws. 35But I will take the kingship out of the hands of his son and give it to you—the ten tribes. 36To his son I will give one tribe, so that there may be a lamp for My servant David forever before Me in Jerusalem—the city where I have chosen to establish My name. 1 Kings 11/26-36 Tanakh JPS 1985.
G-d knew all questions Sheba would possibly ask and all answers Solomon would possibly give. If Solomon would not have had an answer to a question G-d would have spoken with him so that he would have the answer.
This story has a purpose and that purpose was the wisdom of Solomon reflecting the love of G-d for Israel.
This is an example of the purpose of G-d prospering through His servant Solomon. Many other stories of Solomon reveal the worship of false gods and excesses of wealth to the detriment of his Kingdom. He made G-d very angry which led to the creation of the north Kingdom ruled by an Ephraimite of Zeredah named Jeroboam.
Wisdom is as wisdom does and many times Solomon was not wise. When G-d needed a testimony of wisdom Solomon was wise. When G-d needed a testimony of taking a kingdom away for idolatry G-d let Solomon be Solomon.
For thus said the G-d of Israel by the prophet Ahijah of Shiloh to Jeroboam: I am about to tear the kingdom out of Solomon’s hands, and I will give you ten tribes. But one tribe shall remain his—for the sake of My servant David and for the sake of Jerusalem.
The missing tribe would be Benjamin (and the Levites). The tribe of Benjamin was allotted the lands that included Jerusalem and divided the Kingdom of Judah and the Kingdom of Israel.