Saul returned from chasing the Philistines. Then he was told, "David is in the Desert of En Gedi."
References for 1 Samuel 24:1
So Saul took 3,000 of the best soldiers from the whole nation of Israel. He started out to look for David and his men. He planned to look near the Rocky Cliffs of the Wild Goats.
He came to some sheep pens along the way. A cave was there. Saul went in to go to the toilet. David and his men were far back in the cave.
David's men said, "This is the day the LORD told you about. He said to you, 'I will hand your enemy over to you. Then you can deal with him as you want to.' " So David came up close to Saul without being seen. He cut off a corner of Saul's robe.
Later, David felt sorry that he had cut off a corner of Saul's robe.
He said to his men, "May the LORD keep me from doing a thing like that to my master again. He is the LORD's anointed king. So I promise that I will never lift my hand to strike him down. The LORD has anointed him."
David said that to warn his men. He didn't allow them to attack Saul. So Saul left the cave and went on his way.
Then David went out of the cave. He called out to Saul, "King Saul! My master!" When Saul looked behind him, David bowed down. He lay down flat with his face toward the ground.
He said to Saul, "Why do you listen when men say, 'David is trying to harm you'?
This very day you have seen with your own eyes how the LORD handed you over to me in the cave. Some of my men begged me to kill you. But I spared you. I said, 'I will never lift my hand to strike my master down. He is the LORD's anointed king.'
"Look, my father! Look at this piece of your robe in my hand! I cut off the corner of your robe. But I didn't kill you. I want you to know and understand that I'm not guilty of doing anything wrong. I haven't turned against you. I haven't done anything to harm you. But you are hunting me down. You want to kill me.
"May the LORD judge between you and me. And may the LORD pay you back because of the wrong things you have done to me. But I won't lay a hand on you.
People say, 'Evil acts come from those who do evil.' So I won't lay a hand on you.
"King Saul, who are you trying to catch? Who do you think you are chasing? I'm nothing but a dead dog or a flea!
May the LORD be our judge. May he decide between us. May he consider my case and stand up for me. May he show that I'm not guilty of doing anything wrong. May he save me from your powerful hand."
When David finished speaking, Saul asked him a question. He said, "My son David, is that your voice?" And Saul sobbed out loud.
"You are a better person than I am," he said. "You have treated me well. But I've treated you badly.
You have just now told me about the good things you did to me. The LORD handed me over to you. But you didn't kill me.
Suppose a man finds his enemy. He doesn't let him get away without harming him. May the LORD reward you with many good things. May he do it because of the way you treated me today.
I know for sure that you will be king. I know that the kingdom of Israel will be made secure under your control.
Now take an oath in the name of the Lord. Promise me that you won't cut off my children from my family. Also promise me that you won't wipe out my name from my family line."
So David took an oath and made that promise to Saul. Then Saul returned home. But David and his men went up to his usual place of safety.