It happened, when Saul was returned from following the Philistines, that it was told him, saying, Behold, David is in the wilderness of En Gedi.
"David cut off the skirt of Saul's robe"  (1 Samuel 24:4).  Both Young and Keil expressed the opinion that, upon his entry into the cave, Saul laid his robe aside, making it quite easy for David to cut off part of it completely unobserved by Saul.  The darkness of such a cave would also have been a factor in this action.