(In the past the king of Egypt had attacked and captured Gezer. After burning it, he killed the Canaanites who lived there. Then he gave it as a wedding present to his daughter, who married Solomon.
Solomon made an agreement with the king of Egypt by marrying his daughter and bringing her to Jerusalem. At this time Solomon was still building his palace and the Temple of the Lord, as well as a wall around Jerusalem.
The palace where Solomon lived was built like the Hall of Justice, and it was behind this hall. Solomon also built the same kind of palace for his wife, who was the daughter of the king of Egypt.
The daughter of the king of Egypt moved from the old part of Jerusalem to the palace that Solomon had built for her. Then Solomon filled in the surrounding land.
The Ephraimites could not force the Canaanites to leave Gezer, so the Canaanites still live among the Ephraimites today, but they became slaves of the Ephraimites.