David has been fighting Israel's enemies, and Saul has been hunting Israel's future king.
Saul enters a cave to relieve himself, with David and his men hiding in the back of it (v. 3).
David's men read the moment as divine appointment, similar to how Saul has wrongfully read God’s providence into his own actions (v. 4).
David cuts the corner of Saul's robe, and immediately his heart strikes him (vv. 4–5). His conscience is more sensitive to the LORD's anointed than Saul’s or David’s own men’s (v. 6).
David calls after Saul, bows to the ground, and shows Saul how he restrained himself (vv. 8–15), reminding Saul of David’s own covenant to the anointed and the wisdom of the proverbs
Saul weeps and confesses that he has wronged David, and that David is the Lord’s anointed (vv. 16–19).
Saul asks a rhetorical question to show that he understands David is not his enemy, "If a man finds his enemy, will he let him go away safe?"
This whole exchange reminds us of and prepares us for the further distinction of Saul and David.
Saul will return to hunting David again in ch. 26.
David will hold himself to this oath even after Saul's death (2 Samuel 9).