Saul was a man who walked by sight and not by faith. Having learnt that David was in the town of Keilah, he assumed that David intended to remain there since it was a fortified town (with gates and bars). This would have given Saul a chance to trap David and he assumed that it was God’s will. He was deluded in thinking that these circumstances confirmed that the Lord was on his side.
7 Now it was told Saul that David had come to Keilah. And Saul said, “God has given him into my hand, for he has shut himself in by entering a town that has gates and bars.”