In this chapter, the Philistines gather to fight against Israel, and David is spared having to fight against his own people.
I can't remember if I mentioned this before, but I highly recommend listening to (or reading) Mike Bickle's series on the life of David. It is available for free online (just search for "Mike Bickle life of David" on your favorite search engine). That series is where I learned a lot of the things that I have written about David in this commentary.
Anyway, we have known for a couple chapters now that the Philistines are preparing for battle. In the previous chapter, Achish (king of Gath, a city in Philistia) asked David to fight with him as his bodyguard, i.e. a highly trusted and elite unit whose purpose is to protect the king during battle. David agrees to do it, but I can't help but suspect there is some reluctance on his part underneath his boastful response in 1 Samuel 28:2, because David had previously told Achish he was raiding the Israelites when in truth he was attacking hostile Canaanite tribes. Now that David has been asked to fight along the Philistines, the ruse is up; OR IS IT????
David has another moment of miraculous luck (of which there have been several, like when the Philistines raided Israel just in time to draw Saul away from catching David?). In this case, his miraculous luck is when the commanders of the Philistines demand that "these Hebrews" should not be present during the battle, because they are afraid that David and his men will betray them.
In prior chapters, I explained that battles in the Old Testament time period are heavily influenced by morale. That's why Deut 20 permits the "afraid" or "fainthearted" man to leave a battle, because a panic or rout can begin with a single person and spread to cause an entire army to be defeated.
In this case, even if David only has 200 men and the Philistine army is more than 10 thousand, those 200 men could cause a panic in the Philistine army if they attacked at the right time and cause the Philistines to be defeated. So I think the Philistine commanders are well-justified in their fears.
I also think it's hilarious that the Philistines mention the song exalting David's victories in v. 5. It must have been a very popular song that they would still be talking about it years after David slew Goliath.
I also enjoy the conversation between David and Achish. Achish is obviously a huge fan of David, and he's trying to "let David down gently", telling him that while he is pleased with David, the other Philistine lords do not trust David. David, for his part, is acting wounded, asking what he could have possibly done wrong to get himself kicked out of this battle.
He is behaving as if he wished to fight against the Israelites. But we know something Achish doesn't know: that David twice had the opportunity to murder Saul, and both times he declined to "stretch forth his hand against the LORD's anointed". Even though Saul has tried to kill David many times, David has never tried to harm Saul even when he had the opportunity to do so. Additionally, when the Philistines were plundering Keilah, David inquired of the LORD if he should go save Keilah, even at great personal risk. So even in exile, David was fighting to protect the people of Israel and fighting against their enemies, even sometimes fighting against the Philistines.
Knowing all this, I think we can be certain that David would never attack Israel. He was anointed king over this country, he fought their enemies many times over the years and won many great victories, and continued fighting for Israel even while Saul was seeking his life. Getting kicked out of this battle by the Philistine commanders is remarkable fortune to David, because it keeps him out of a situation where he would have to betray Achish.