When Saul returned from following the Philistines, he was told, "David is in the wilderness of En-gedi."
Then Saul took three thousand chosen men out of all Israel, and went to look for David and his men in the direction of the Rocks of the Wild Goats.
He came to the sheepfolds beside the road, where there was a cave; and Saul went in to relieve himself. Now David and his men were sitting in the innermost parts of the cave.
References for 1 Samuel 24:3
The men of David said to him, "Here is the day of which the Lord said to you, "I will give your enemy into your hand, and you shall do to him as it seems good to you.' " Then David went and stealthily cut off a corner of Saul's cloak.
Afterward David was stricken to the heart because he had cut off a corner of Saul's cloak.
He said to his men, "The Lord forbid that I should do this thing to my lord, the Lord's anointed, to raise my hand against him; for he is the Lord's anointed."
So David scolded his men severely and did not permit them to attack Saul. Then Saul got up and left the cave, and went on his way.
Afterwards David also rose up and went out of the cave and called after Saul, "My lord the king!" When Saul looked behind him, David bowed with his face to the ground, and did obeisance.
David said to Saul, "Why do you listen to the words of those who say, "David seeks to do you harm'?
This very day your eyes have seen how the Lord gave you into my hand in the cave; and some urged me to kill you, but I spared you. I said, "I will not raise my hand against my lord; for he is the Lord's anointed.'
References for 1 Samuel 24:10
See, my father, see the corner of your cloak in my hand; for by the fact that I cut off the corner of your cloak, and did not kill you, you may know for certain that there is no wrong or treason in my hands. I have not sinned against you, though you are hunting me to take my life.
May the Lord judge between me and you! May the Lord avenge me on you; but my hand shall not be against you.
As the ancient proverb says, "Out of the wicked comes forth wickedness'; but my hand shall not be against you.
Against whom has the king of Israel come out? Whom do you pursue? A dead dog? A single flea?
May the Lord therefore be judge, and give sentence between me and you. May he see to it, and plead my cause, and vindicate me against you."
When David had finished speaking these words to Saul, Saul said, "Is this your voice, my son David?" Saul lifted up his voice and wept.
He said to David, "You are more righteous than I; for you have repaid me good, whereas I have repaid you evil.
Today you have explained how you have dealt well with me, in that you did not kill me when the Lord put me into your hands.
For who has ever found an enemy, and sent the enemy safely away? So may the Lord reward you with good for what you have done to me this day.
Now I know that you shall surely be king, and that the kingdom of Israel shall be established in your hand.
Swear to me therefore by the Lord that you will not cut off my descendants after me, and that you will not wipe out my name from my father's house."
So David swore this to Saul. Then Saul went home; but David and his men went up to the stronghold.