They told David, saying, Behold, the Philistines are fighting against Keilah, and are robbing the threshing floors.
"David inquired of the Lord"  (1 Samuel 23:1).  We are not told how David did this, but  1 Samuel 23:6-14, below, explains that Abiathar had joined David's forces, bringing the ephod with him.