David navigated a highly sensitive situation while living in Philistine territory, requiring a calculated strategy of total destruction to maintain his cover. To hide his true targets from Achish, the king of Gath, David ensured that no men or women survived his military raids against foreign nations like the Geshurites [מצודת דוד, ביאור שטיינזלץ].
The primary motivation for taking no captives was the fear that his secret would be exposed. If David had brought prisoners back to Gath, they would have revealed the truth about his actions [מלבי״ם]. Surviving captives would have informed Achish that David was actually attacking foreign nations rather than his own people, completely ruining the false loyalty he had carefully projected [מצודת דוד, ביאור שטיינזלץ].
By leaving no witnesses alive, David guaranteed that Achish would continue to believe the raids were directed against the Israelites, even though David never actually harmed his own people during any of his campaigns [ביאור שטיינזלץ]. This extreme method of concealment was not an isolated tactic, but rather David's established custom and regular habit throughout his entire stay in Philistine territory [מצודת ציון].