The God of unlimited intelligence has a virtually infinite amount of contingency plans that will be enacted just in case things unfold a certain way, and each and every one of these contingency plans are just as perfect as they'd have been if God had
foreknown as a certainty that things would unfolded this particular way.