Keilah was about three miles southeast of Adullam in the Shephelah, the foothills between the coastal plain on the west and the hill country of Judah on the east. The Philistines were plundering the threshing floors there. The threshing floors where places where the Israelites stored their threshed grain after threshing it (cf. 2 Kings 6:27; Joel 3:24). David sought to defend his countrymen and fellow Judahites from their hostile foreign enemy even though he was having to watch out for Saul. Saul should have come to their rescue since he was the king, but there is no mention of him doing so.
The writer recorded in this passage that David inquired of the Lord four times (vv. 2, 4, 10, 11). He placed himself under God's authority, though Saul did not. For this reason God could and did work through David as His vice-regent. God manifested His will through the Urim and Thummim in the priestly ephod (vv. 6, 9; cf. Exod. 28:28).235Evidently Abiathar interpreted the will of God for David.
David was not just defending himself during this period of his life. He was aggressively carrying out the will of God by defeating Israel's enemies as the Lord's anointed servant. God told David to go against the Philistines first. Then in response to David's second prayer, He promised that He (emphatic in the Hebrew text) would give the Philistines into David's hand. David's 600 men (v. 13) were understandably afraid to attack the Philistines who had greater numbers and stronger forces. Nevertheless David attacked and soundly defeated the Philistines because of God's promise and power. The writer gave credit to David for the victory (v. 5), but clearly it was God who enabled him to win against such a daunting foe (v. 4).