It was reported to David that the Philistines were raiding Keilah and looting the grain.
David went in prayer to God: "Should I go after these Philistines and teach them a lesson?" God said, "Go. Attack the Philistines and save Keilah."
But David's men said, "We live in fear of our lives right here in Judah. How can you think of going to Keilah in the thick of the Philistines?"
So David went back to God in prayer. God said, "Get going. Head for Keilah. I'm placing the Philistines in your hands.
David and his men went to Keilah and fought the Philistines. He scattered their cattle, beat them decisively, and saved the people of Keilah.
After Abiathar took refuge with David, he joined David in the raid on Keilah, bringing the Ephod with him.