The Ziphites came to Saul to Gibeah, saying, Doesn't David hide himself in the hill of Hachilah, which is before the desert?
"When he saw that Saul came after him"  (1 Samuel 26:3).  This is an idiomatic expression meaning that David had heard that Saul was coming after him.  If he had seen Saul doing so, he would not have needed to send out spies.