2 So David, questioning the Lord, said, Am I to go and make an attack on these Philistines? And the Lord said to David, Go and make an attack on the Philistines so that Keilah may be kept from falling into their hands.

Matthew Henry's Commentary on 1 Samuel 23:2

Commentary on 1 Samuel 23:1-6

(Read 1 Samuel 23:1-6)

When princes persecute God's people, let them expect vexation on all sides. The way for any country to be quiet, is to let God's church be quiet in it: if Saul fight against David, the Philistines fight against his country. David considered himself the protector of the land. Thus did the Saviour Jesus, and left us an example. Those are unlike David, who sullenly decline to do good, if they are not rewarded for services.