Historical commentary by Matthew Henry. The wording and interpretations below belong to the original source.
David Delivers Keilah. ( b. c. 1057.)
Now we find why the prophet Gad (by divine direction, no doubt) ordered David to go into the land of Judah, ch. xxii. 5 . It was that, since Saul neglected the public safety, he might take care of it, notwithstanding the ill treatment that was given him; for he must render good for evil, and therein be a type of him who not only ventured his life, but laid down his life, for those that were his enemies.
I. Tidings are brought to David, as to the patron and protector of his country's liberties, that the Philistines had made a descent upon the city of Keilah and plundered the country thereabouts, v. 1 . Probably it was the departure both of God and David from Saul that encouraged the Philistines to make this incursion. When princes begin to persecute God's people and ministers, let them expect no other than 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 shall fight against his country.
II. David is forward enough to come in for their relief, but is willing to enquire of the Lord concerning it. Here is an instance, 1. Of David's generosity and public-spiritedness. Though his head and hands were full of his own business, and he had enough to do, with the little force he had, to secure himself, yet he was concerned for the safety of his country and could not sit still to see that ravaged: nay, though Saul, whose business it was to guard the borders of his land, hated him and sought his life, yet he was willing, to the utmost of his power, to serve him and his interests against the common enemy, and bravely abhorred the thought of sacrificing the common welfare to his private revenge. Those are unlike to David who sullenly decline to do good because they have not been so well considered as they deserved for the services they have done. 2. Of David's piety and regard to God. He enquired of the Lord by the prophet Gad; for it should seem (by v. 6 ) that Abiathar came not to him with the ephod till he was in Keilah. His enquiry is, Shall I go and smite these Philistines? He enquires both concerning the duty (whether he might lawfully take Saul's work out of his hand, and act without a commission from him) and concerning the event, whether he might safely venture against such a force as the Philistines had with such a handful of men at his feet, and such a dangerous enemy as Saul was at his back. It is our duty, and will be our case and comfort, whatever happens, to acknowledge God in all our ways and to seek direction from him.