David thought to himself, "Sooner or later, Saul's going to get me. The best thing I can do is escape to Philistine country. Saul will count me a lost cause and quit hunting me down in every nook and cranny of Israel. I'll be out of his reach for good."
So David left; he and his six hundred men went to Achish son of Maoch, king of Gath.
They moved in and settled down in Gath, with Achish. Each man brought his household; David brought his two wives, Ahinoam of Jezreel and Abigail, widow of Nabal of Carmel.
When Saul was told that David had escaped to Gath, he called off the hunt.
Then David said to Achish, "If it's agreeable to you, assign me a place in one of the rural villages. It doesn't seem right that I, your mere servant, should be taking up space in the royal city."
So Achish assigned him Ziklag. (This is how Ziklag got to be what it is now, a city of the kings of Judah.)
David lived in Philistine country a year and four months.
From time to time David and his men raided the Geshurites, the Girzites, and the Amalekites - these people were longtime inhabitants of the land stretching toward Shur and on to Egypt.
When David raided an area he left no one alive, neither man nor woman, but took everything else: sheep, cattle, donkeys, camels, clothing - the works. Then he'd return to Achish.
Achish would ask, "And whom did you raid today?"
He never left a single person alive lest one show up in Gath and report what David had really been doing. This is the way David operated all the time he lived in Philistine country.
Achish came to trust David completely. He thought, "He's made himself so repugnant to his people that he'll be in my camp forever."