The sudden realization of a massive military threat triggers mass panic among the Israelites, sending them into a desperate search for refuge. This intense fear and vulnerability serve a greater purpose, setting the stage to highlight the sheer magnitude of the miracle God will soon perform by saving His people from a vastly superior enemy [אברבנאל].
The Israelites find themselves in a state of severe distress [מצודת ציון, שטיינזלץ]. The primary approach among commentators is that the nation feels entirely overwhelmed and squeezed by the sheer size of the Philistine army, particularly because the danger descends upon them so suddenly [רד״ק, מצודת דוד, מצודת ציון, שטיינזלץ]. The enemy forces have already set up camp against their cities, tightening their grip on the population and essentially taking control of the land [מלבי״ם]. Alternatively, the pressure is understood to come from the aggressive advance of the Philistines themselves, who approach the Israelites like a cruel taskmaster intent on their complete destruction [אברבנאל].
Overcome by this immense fear, the natural reaction of the people is to flee. Even the soldiers who are trained and expected to fight abandon the battlefield, choosing instead to conceal themselves [מלבי״ם]. In their desperation, the Israelites scatter to a variety of hiding spots. They take cover in thorny thickets [רש״י, מצודת ציון], small rocky crevices [שטיינזלץ], or elevated fortresses [רד״ק, אברבנאל]. They also seek safety in high towers [רש״י, מצודת ציון, רד״ק, שטיינזלץ] and deep pits dug into the earth [רש״י], utilizing every available refuge to escape the looming threat.