When David, his army and family, were fleeing from King Saul he did an unusual strategic move. He became allies with the Philistines’ town of Gath. The king of Gath liked this idea greatly because he saw how David always won battles. The irony of these two being allies is the first highly successful military move David ever made was as a young person when he killed the giant, Goliath, who was from Gath. Gath was still an enemy of Israel. Although David was on friendly terms with this king, his heart was still faithful to Israel but King Achish was fully convinced otherwise and asked David and his army to go to war with his people against Israel. King Achish even appointed David to be his personal bodyguard.
1 Samuel 27-28:2
And David said in his heart, “Now I shall perish someday by the hand of Saul. There is nothing better for me than that I should speedily escape to the land of the Philistines; and Saul will despair of me, to seek me anymore in any part of Israel. So I shall escape out of his hand.” 2 Then David arose and went over with the six hundred men who were with him to Achish the son of Maoch, king of Gath. 3 So David dwelt with Achish at Gath, he and his men, each man with his household, and David with his two wives, Ahinoam the Jezreelitess, and Abigail the Carmelitess, Nabal’s widow. 4 And it was told Saul that David had fled to Gath; so he sought him no more.
5 Then David said to Achish, “If I have now found favor in your eyes, let them give me a place in some town in the country, that I may dwell there. For why should your servant dwell in the royal city with you?” 6 So Achish gave him Ziklag that day. Therefore Ziklag has belonged to the kings of Judah to this day. 7 Now the time that David dwelt in the country of the Philistines was one full year and four months.
8 And David and his men went up and raided the Geshurites, the Girzites,[a] and the Amalekites. For those nations were the inhabitants of the land from of old, as you go to Shur, even as far as the land of Egypt. 9 Whenever David attacked the land, he left neither man nor woman alive, but took away the sheep, the oxen, the donkeys, the camels, and the apparel, and returned and came to Achish. 10 Then Achish would say, “Where have you made a raid today?” And David would say, “Against the southern area of Judah, or against the southern area of the Jerahmeelites, or against the southern area of the Kenites.” 11 David would save neither man nor woman alive, to bring news to Gath, saying, “Lest they should inform on us, saying, ‘Thus David did.’” And thus was his behavior all the time he dwelt in the country of the Philistines. 12 So Achish believed David, saying, “He has made his people Israel utterly abhor him; therefore he will be my servant forever.”
28 Now it happened in those days that the Philistines gathered their armies together for war, to fight with Israel. And Achish said to David, “You assuredly know that you will go out with me to battle, you and your men.”
2 So David said to Achish, “Surely you know what your servant can do.”
And Achish said to David, “Therefore I will make you one of my chief guardians forever.”