1 Samuel 27:8

And David and his men went up, and invaded the Geshurites, and the Gezrites, and the Amalekites: for those nations were of old the inhabitants of the land, as thou goest to Shur, even unto the land of Egypt.

David and his men went up to make war on and raid the Geshurites and the Gezrites and the Amalekites, nations that of old were the inhabitants of the land in the region stretching toward Shur even as far as Egypt. This took place while he was dwelling under Philistine protection. To prevent word of the raids from being carried to Gath, he left neither man nor woman alive. He then deceived Achish about which people he had attacked.

That deception led Achish to conclude that David had made himself utterly hated by his own people Israel and had turned against them, and in that way it strengthened the Philistines. Such a course was a poor return for the favor of protection the Philistines had extended to him. Instead of defending God's people and fulfilling his calling to protect them, his conduct failed to do so.