Think of God as an NFL official who is also a football commentator for ESPN. It is the end of the season, and the Super Bowl is over. God is giving a report on the season in review.
Since all the games have been played, God knows every score, every play, and the outcome of every down. He knows who caught the ball, and who failed to make a tackle. He can analyze every aspect, or watch it in slow motion. God has knowledge of everything that happened that season.
As an NFL official, God also constructed the rules of the game. He picked the people who would officiate, and used the “instant replay” when necessary to overturn a few bad decisions, in order to make sure that the rules that he set came out the way they were intended.
Now, that said, God did not actually interfere in any of the plays, nor did he play the game for the people. Each coach, and player could have made any decision they chose. In a given situation, a quarterback could have opted to run the ball, make a pass, take a knee, or, heaven forbid, even throw the game. God did not make any of these decisions. He granted the players free will to play however they desired. This, however, does not in any way impact the fact that God still knows what happened, since it’s the end of the season, nor does it change the fact that God provided the rules to the game.
Eternity is a difficult concept, and it works a bit like that. Imagine God sitting at the end of time looking back at everything that has happened and knowing the outcome. He was able to construct rules… a plan… but still give us free will. It is a daunting concept to wrap one’s mind around.