Jerusalem's King Adoni-zedek heard that Joshua had captured Ai and had wiped it out as something reserved for God. Joshua did the same thing to Ai and its king that he had done to Jericho and its king. He also heard that the population of Gibeon had made peace with Israel and were living among them.
References for Joshua 10:1
Adoni-zedek and his people were very afraid, because Gibeon was a large city, like one of the royal cities. It was larger than Ai. All its men were soldiers.
References for Joshua 10:2
So Jerusalem's King Adoni-zedek sent word to Hebron's King Hoham, Jarmuth's King Piram, Lachish's King Japhia, and Eglon's King Debir:
"Come up and help me. We will strike at Gibeon, because it has made peace with Joshua and with the Israelites."
Then the five kings of the Amorites gathered. These were the kings of Jerusalem, Hebron, Jarmuth, Lachish, and Eglon. They went up with all their armies, camped against Gibeon, and attacked it.
The people of Gibeon sent word to Joshua in the camp at Gilgal: "Don't desert your servants! Come to us quickly. Rescue us! Help us! All the Amorite kings from the highlands have assembled together against us."
So Joshua went up from Gilgal with the entire army and all the bravest soldiers.