Who "said to kill you"?
Rashi: A word is missing - someone (unspecified) said to kill you.
Targum Yonasan: Others said to kill you. Radak - i.e. every one of David's men, had he not dissuaded them.
Radak citing Sanhedrin 72a: The Torah said, if one seeks to kill you, kill him first - "Im b'Machteres Yimatzei ha'Ganav" (Shemos 22:1). I was permitted to kill you, had I not had mercy on you.
"Va'Techas" is feminine. Who "had mercy on you"?
Rashi, Targum Yonasan: A word is missing - my soul had mercy on you. This is like "va'Techal David ha'Melech Latzeis El Avshalom" (Shmuel II, 13:39) - his soul desired.
Radak citing Brachos 62b: Your modesty [caused that I] had mercy on you. 1 (Sha'ul was so careful not to expose himself while defecating, even though he was sure that he is alone. David could not bring himself to kill such a person. - PF)
Malbim: My hand had mercy on you. Hand is feminine. "Chus' refers to something that one does not want to destroy, for he has benefit from it.
Ya'avetz (62b, citing Megilah 14b): In the merit of Rachel's modesty, Sha'ul descended from her. In the merit of Sha'ul's modesty, Esther descended from him. Semichus Chachamim (cited in Daf Al ha'Daf 62b) - David saw this with Ru'ach ha'Kodesh, and was concerned lest Sha'ul had not yet fathered the child from whom Esther would descend.
What was David's proof that he does not seek to harm Sha'ul?
Malbim: If one wants to harm another, but does not, it is because he cannot, or fears Hashem, or fears people. You cannot say that I could not harm you - you were in my hands in the cave! I was not afraid of people - no one was with you in the cave! 1 I was not afraid of Hashem - He said to kill (the one who pursues you, i.e.) you!
Is it not reasonable that Sha'ul's men were looking at the entrance, and would have noticed if David left? If Sha'ul delayed too long before returning, they would have gone to investigate, like regarding Eglon (Shoftim 3:25)! (PF)