1 Samuel 27:12

And Achish believed David, saying, He hath made his people Israel utterly to abhor him; therefore he shall be my servant for ever.

David gave Achish the false impression that his raids were directed against Judah, and that misleading implication confirmed the king in his mistaken conclusion. Achish became convinced that David had made his own people Israel utterly abhor him and had become alienated from them. On that basis he expected that David would remain his servant permanently.

The favor shown to David by the Philistines was driven by their hope that he would join them against Saul and Israel. The deception strengthened the Philistines by leading their king to regard David as no longer a threat, while at the same time concealing from them their own weakness.