An invading army often relies on its own sense of invincibility, marching toward its target with absolute confidence. The enemies who gathered against the city initially arrived with exactly this kind of boldness, completely devoid of fear. However, a sudden and dramatic shift occurred the moment they laid eyes upon their destination, causing an immediate and total collapse of their courage [אלשיך].
The primary approach among commentators is that these foreign kings suddenly perceived God's direct intervention. They witnessed His wonders, His might, and His undeniable presence within the palaces of the city, realizing that He Himself had stepped forward to fight against them. Alternatively, the overwhelming sight may have been the sheer physical size, glory, and power of the city itself [ביאור שטיינזלץ].
Whatever the exact nature of the sight, the reaction was immediate shock and terror. Overcome by a profound sense of threat, the attackers fell into a state of frantic confusion and panic [רש״י, מצודת ציון]. Stripped of their former bravery, they abandoned their plans entirely, hurrying to flee and escape the area as quickly as possible [ביאור שטיינזלץ].