Now David knew that Saul was plotting evil against him; so he said to Abiathar the priest, “Bring the ephod here.” Then David said, “O LORD God of Israel, Your servant has heard for certain that Saul is seeking to come to Keilah to destroy the city on my account. Will the men of Keilah surrender me into his hand? Will Saul come down just as Your servant has heard? O LORD God of Israel, I pray, tell Your servant.” And the LORD said, “He will come down.” Then David said, “Will the men of Keilah surrender me and my men into the hand of Saul?” And the LORD said, “They will surrender you.” Then David and his men, about six hundred, arose and departed from Keilah, and they went wherever they could go. When it was told Saul that David had escaped from Keilah, he gave up the pursuit.
One member of The Society of Evangelical Arminians explains: “So what we find here is that God knew what would happen if David went to Keilah - he would meet Saul there, for God foreknew that Saul would be there, and that those in Keilah would hand him over to Saul. But this did not happen. David left the area of Keilah. God knew what would happen, even that which did not happen. God foreknows future contingencies, and is not directing every event by a strict necessity or predetermined decree.” (SEA, emphasis mine)
This is similar to Matthew 11:20-24, in which Jesus indicated that if the people of certain pagan cities had seen the miracles that were performed in Israel, that unlike Israel, they would have repented, and in having repented, they would not have been destroyed, and therefore would have had a lineage existing into the present day. Thus you have a similar example of God’s knowledge of “contingencies,” otherwise known as Middle Knowledge.
This member adds: “So what we find here is that God knew what would happen if David went to Keilah - he would meet Saul there, for God foreknew that Saul would be there, and that those in Keilah would hand him over to Saul. But this did not happen. David left the area of Keilah. God knew what would happen, even that which did not happen. God foreknows future contingencies, and is not directing every event by a strict necessity or predetermined decree. Second, according to 1st Samuel 24:4, God left a matter in David’s own hands: “The men of David said to him, ‘Behold, this is the day of which the LORD said to you, “Behold; I am about to give your enemy into your hand, and you shall do to him as it seems good to you.”’ Then David arose and cut off the edge of Saul’s robe secretly.” So, what did David do? He spared Saul’s life. But God permitted David to do whatever he wanted to do. David had more than one option before him. He could kill Saul in the cave, or he could let him live. God did not tell David what to do, as though it was already predetermined by decree, but allowed David to choose.” (SEA, emphasis mine)