After Saul returned from pursuing the Philistines, he was told, "David is in the Desert of En Gedi.1"
References for 1 Samuel 24:1
So Saul took three thousand chosen men from all Israel and set out to look2 for David and his men near the Crags of the Wild Goats.
References for 1 Samuel 24:2
He came to the sheep pens along the way; a cave3 was there, and Saul went in to relieve4 himself. David and his men were far back in the cave.
References for 1 Samuel 24:3
The men said, "This is the day the LORD spoke5 of when he said to you, 'I will give your enemy into your hands for you to deal with as you wish.' "6 Then David crept up unnoticed and cut7 off a corner of Saul's robe.
References for 1 Samuel 24:4
Afterward, David was conscience-stricken8 for having cut off a corner of his robe.
References for 1 Samuel 24:5
He said to his men, "The LORD forbid that I should do such a thing to my master, the LORD's anointed,9 or lift my hand against him; for he is the anointed of the LORD."
References for 1 Samuel 24:6
With these words David rebuked his men and did not allow them to attack Saul. And Saul left the cave and went his way.
Then David went out of the cave and called out to Saul, "My lord the king!" When Saul looked behind him, David bowed down and prostrated himself with his face to the ground.10
References for 1 Samuel 24:8