As the Philistines passed in review prior to attacking Israel, David and his men were in array with Achish. The Lords of the Philistines asked why the Hebrews were among their ranks. Achish reminded them of David’s loyalty and his ability. However, the other leaders were angry with Achish, and refused to allow David to fight with them, for fear that he would turn on them during battle. Achish had to send David away, even though he applauded his loyalty. So David went back to the land of the Philistines.
David and his men came to Ziklag, and found that the Amalekites had attacked the city and taken the women. The men of David mourned, and David called for the ephod and consulted God about whether to pursue the Amalekites. God told him to pursue and overtake them. David took off and then found an Egyptian that had been left behind. He led them to the Amalekites. David attacked the Amalekites and took back everything that was taken from Ziklag, including all the women. David and the 400 men returned to 200 men who stayed at the Brook Besor, and shared of the spoil with them. He also sent some of the spoil to Judah, to his friends.
David was put in an untenable position by having to possibly go to battle with the Philistines against Israel. However, the Philistines’ distrust of him led them to kick him out of the army. This very well could have been the providence of God. One other possible thing to consider, though: While David and his men were running with the Philistines, the Amalekites were taking their stuff from Ziklag. It is important to make sure you don’t hang with the wrong crowd! However, once God gave them an opportunity to get back to where they should live, He also went with them to get back their stuff. Be sure to trust God and walk with Him and don’t hang with the wrong crowd. It could cost you!