Some commentators argue that David’s slaughter of the desert raiders was not a result of him continuing the ban warfare begun by Joshua, but rather an attempt to ensure there was no one left alive to expose his actions before Achish.1 This was most certainly one of the motivations behind David’s actions seeing as it is explicitly mentioned in 1 Samuel 27:11.
9 And David would strike the land and would leave neither man nor woman alive, but would take away the sheep, the oxen, the donkeys, the camels, and the garments, and come back to Achish.