The news of Samson infiltrating enemy territory sparks a calculated and cautious manhunt. Knowing his immense physical power, the locals avoid a direct confrontation and instead adopt a strategy of stealth, encirclement, and ambush.
The primary approach among commentators is that the people of Gaza were simply informed of his arrival. However, a unique perspective suggests that Samson himself spread the rumor that he had entered the city, carefully keeping his actual identity hidden [מלבי״ם]. Because the locals did not know exactly which house he was in, and because they were terrified of facing him head-on, they began to circle and roam throughout the city in search of him [מצודת דוד, מלבי״ם, ביאור שטיינזלץ]. Believing they had him trapped, they locked the city gates and positioned an ambush there. They reasoned that whenever he eventually decided to leave, he would be forced to pass through those very gates [רלב״ג, מצודת דוד, מלבי״ם].
As they prepared their trap, the people adopted a careful demeanor. One approach explains that they maintained complete silence, pretending to be entirely unaware of his presence so that he would not be put on his guard [רש״י, רד״ק, מצודת דוד, מצודת ציון]. Another perspective understands their actions as secret plotting, whispering among themselves to devise a plan to kill him [מצודת ציון, מצודת דוד, ביאור שטיינזלץ]. Ultimately, their strategy relied on patience. They decided to wait until the morning light illuminated the sky [מלבי״ם]. They expected that at dawn, Samson would approach the city gates to leave, giving them the perfect opportunity to capture and kill him [מצודת דוד, ביאור שטיינזלץ].