Answer:
God has the ability to know the future, but that does not mean that he foreordained what will happen. He could do so, but he chooses not to, instead he sets things in motion and let's them develop knowing all the possible outcomes, and knowing that he can do whatever he needs to do to accomplish his purpose in the end.