Likewise, God knows Satan. He knows his every move—how he reacts under pressure, what's important to him. God knows everything about him. God knew that Satan would orchestrate the death of his Son. So much so that God would prophesy about it in Isaiah 53, decades before it happened. It wasn't that God plotted to kill his own Son but rather that he gave Satan an opportunity.
In a similar manner, it is not the sun that causes darkness; rather, it is when the sun withdraws that there is darkness. Sometimes God withdraws his protection, and Satan has an opportunity. We see this in the book of Job when God withdraws his protection from Job.
We can live securely in the knowledge that God is never the initiator of evil. He sometimes withdraws his protection and allows evil but only if He can bring good from it. God is never surprised by Satan’s tactics, or by evil people.
It is a great comfort to know that God's plans cannot be thwarted by Satan. This is a truth Job learned through his trials, "I know that you can do all things; no purpose of yours can be thwarted" (Job 42:2), and it is something on which we can rely.
We can rest in this knowledge and know that our lives are safe in His hands.