Three of the Thirty chiefs went down to the rock, to David, who was in the cave of Adullam while the Philistines were encamped in the valley of Rephaim.
When he came to the sheepfolds along the way, he found a cave, which he entered to relieve himself. David and his men were occupying the inmost recesses of the cave.