The Philistines brought all their military units together at Aphek while Israel was camped by the spring in Jezreel.
References for 1 Samuel 29:1
As the Philistine leaders were passing [in review with their units of] hundreds and thousands, David and his men were passing [in review] behind them with Achish.
Then the Philistine commanders asked, "What are these Hebrews [doing here]?" Achish answered the Philistine commanders, "That is David, servant of King Saul of Israel. He has been with me a considerable period of time. From the day he defected until today, I've found no fault with him."
References for 1 Samuel 29:3
The Philistine commanders, however, were enraged with Achish and told him, "Send that man back and let him return to the place you assigned him. He must not go down with us into battle only to become our adversary during the battle. What better way could he regain his master's favor than with the heads of our men?
Isn't this the David they sing about during their dances: Saul has killed his thousands, but David his tens of thousands?"
References for 1 Samuel 29:5
So Achish summoned David and told him, "As the Lord lives, you are an honorable man. I think it is good to have you working with me in the camp, because I have found no fault in you from the day you came to me until today. But the leaders don't think you are reliable.
References for 1 Samuel 29:6
Now go back quietly and you won't be doing [anything] the Philistine leaders think is wrong."
"But what have I done?" David replied to Achish. "From the first day I was with you until today, what have you found against your servant to keep me from going along to fight against the enemies of my lord the king?"
Achish answered David, "I'm convinced that you are as reliable as an angel of God. But the Philistine commanders have said, 'He must not go into battle with us.'
So get up early in the morning, you and your masters' servants who came with you. When you've all gotten up early, go as soon as it's light."
References for 1 Samuel 29:10
So David and his men got up early in the morning to return to the land of the Philistines. And the Philistines went up to Jezreel.