Facing the advancing Israelite army, the king of Jerusalem makes a calculated strategic assessment. Recognizing that a direct military confrontation with the Israelites would end in defeat, he chooses instead to redirect his forces against Gibeon to punish them for their surrender [ביאור שטיינזלץ].
This military campaign against Gibeon is justified as a necessary response to a deep betrayal. The local kings had previously agreed to form a united regional alliance to fight against the incoming conquerors. By breaking this general consensus and violating the rules of their pact, the Gibeonites actively harmed the collective effort and provided aid to the enemy [מלבי״ם, ביאור שטיינזלץ].
Beyond the obvious political and military damage, Gibeon's decision to make peace with Joshua and the Israelites is viewed as a particularly severe offense due to its devastating psychological fallout [ביאור שטיינזלץ]. Their surrender effectively shattered the morale of the surrounding nations, injecting a deep sense of fear and panic into the hearts of everyone who remained [מצודת דוד].