David lived with Achish at Gath, he and his men, every man with his household, even David with his two wives, Ahinoam the Jezreelitess, and Abigail the Carmelitess, Nabal's wife.
Actually he was wiping out a lot of these little Philistine villages, and Canaanite villages and making out to king Achish that he was fighting against Judah.