1 Samuel 29-30
The Philistine commanders insisted that David and his men leave the battlefield and return home to the land of the Philistines. They were worried that he would turn against them and support the Israelites as he did when he was one of King Saul's officers.
When David and his men returned, they learned that the Amalekites had raided their homes, burning everything and taking captive their wives. David was greatly distressed, but "found strength in the Lord his God." David inquired of the Lord, "Shall I pursue this raiding party? Will I overtake them?" Upon God's direction, David and his men fought and recovered everything the Amalekites had taken, including their wives and all the plunder.