The people in Keilah should have been truly grateful to David. With his group of 600 men, he fought to save them from the Philistines, who had been robbing their supplies of food. However, when Saul threatened to surround their town with his army, they cared little about David's life.
In Ziph, the inhabitants did not even need to be threatened to want to hand over David. They were glad to see an opportunity to please King Saul.
From both of these places, David's escape was truly a miracle. At one, a warning from God himself; at the other, an urgent message for Saul, was all that saved David from capture.
Yet in the middle of all this, David's friend Jonathan, the son of Saul, found him, and strengthened him with a reminder of the promises of God.