Not only did He know it, but He ordained it. God, in His infinite wisdom and His sovereignty, that is, His absolute authority over all things, wills everything that comes to pass in history. He doesn’t do it in a way that turns us into puppets or violates our freedom; nevertheless, it is His counsel and His good pleasure that there would be a fall.
God didn’t force Adam and Eve to sin, but from all eternity He knew it, He ordained it, and it was part of His glorious plan of redemption. As hard as it is to imagine, even sin, in the final analysis, redounds to the glory of God. And God does everything for His own glory, including creating a world that He knows will fall into sin.