1 Samuel 27:8-9 (HCSB)

David and his men went up and raided the Geshurites, the Girzites, and the Amalekites. From ancient times they had been the inhabitants of the region through Shur as far as the land of Egypt. Whenever David attacked the land, he did not leave a single person alive, either man or woman, but he took flocks, herds, donkeys, camels, and clothing. Then he came back to Achish,

     What are we to do with passages like this one?  David and his men raid people, kill everyone, and bring back captured booty.  
     Commentators differ.  Some avoid the question altogether.  Matthew Henry claims—with little textual justification—that this was punishment ordained by God upon those people.  It is true that God sometimes used Israel to bring judgment and destruction upon people for their sins, but there is no indication that this was happening here.  Henry could be correct, but we do not know that he is.
     One of the things we must remember is that the Old Testament writers—especially of the historical books—were descriptive and not prescriptive in their narration.  In other words, they are often content to describe events and leave it to the reader to figure out whether or not the event that happened was directed by God or simply the behavior of that particular person.  
     NAC agrees with Matthew Henry: At his isolated base of operations in Philistine-controlled Judah, David was out from under the watchful eye of Achish. Ever the faithful servant of the Lord, David used this opportunity to pursue the Torah mandate to conquer the Promised Land. “David and his men went up and raided” (v. 8) three different groups. God had given the land of “the Geshurites,” located in Judah’s tribal allotment, to Israel; however, Israel had failed to take control of that region (cf. Josh 13:1–2). The Lord had also commanded Israel to eliminate “the Amalekites” (cf. Exod 17:15–16; Deut 25:17–19). Saul had failed to accomplish the task (cf. chap. 15), but David heeded the Torah mandate. “The Girzites”144 are otherwise unknown, but like the Geshurites and Amalekites, “had lived in the land extending to Shur and Egypt” and thus were partially in territory that legitimately belonged to Judah.
     Tom Constable agrees: David used his opportunity to defeat and to annihilate the common enemies of Israel and the Philistines that lived to Israel’s southwest. David did not leave any survivors, as the Lord had commanded (Deut. 3:18–20; Josh. 1:13). He was clearing the Promised Land of foreign foes so the Israelites could occupy it.

     Faithlife Study Bible agrees: Israel should have exterminated these ancient enemies during their conquest of the promised land (see Deut 20:16–17). David is thus fulfilling the Law and does not incur bloodguilt for their deaths (see 25:26 and note).

     I tend to agree with these commentators, although one obviously can’t be sure.  There is no indication that God was dissatisfied with David’s actions, but we do need to be careful to remember that the author often leaves it up to the reader to figure that out.
     It is easy to sit from our own cultural distance and condemn the seeming bloodthirstiness of the culture in which David lived.  However, considering the appalling numbers of children that are killed every year by abortion, our culture has no room to throw stones.