Whatever God knew, Abraham at any rate did not know that his obedience could endure such a command until the event taught him: and the obedience which he did not know that he would choose, he cannot be said to have chosen. The reality of Abraham’s obedience was the act itself; and what God knew in knowing that Abraham “would obey” was Abraham’s actual obedience on that mountain top at that moment. To say that God “need not have tried the experiment” is to say that because God knows, the thing known by God need not exist.
From C.S. Lewis, The Problem of Pain