After this it came about that David attacked the Philistines and defeated them. He took Gath and its villages out of the Philistines' control.