Question: How could the devil have thought to win a battle against God? Didn't he see from the beginning that this was impossible?
Response: One thing we can learn from Satan's rebellion (and on this see The Satanic Rebellion part #1 especially, where the argument is spelled out in full), is that faithfulness vs. rebellion is not an issue of intelligence or information. The angels had, compared to us, total creature information, yet a large number of them fell in with the devil anyway. They knew God very well, and still decided to rebel against Him. Human beings are far more limited than angels (at the present) in all sorts of ways - longevity, geography, intellect, information, etc. But we still all see and marvel at God's creation (cf. esp. Ps.19:1-4; Rom.1:19-20; 10:18-21), therefore we all are made aware of Him and of His greatness, and for all who take this insight and seek Him, He shows the way in Jesus Christ. Why do some accept Him and some reject Him? Why did so many angels rebel against Him? Those angels who fell, those human beings who choose to reject the Creator of the universe, all do so of their own free will. That choice comes from within, in the same way the choice to remain faithful and the choice to seek Him come from within. If we could not choose against Him, we could not choose for Him. I thank God that you and I chose for Him in Jesus Christ. It was not that we were smarter, or richer or better or stronger (1Cor.1:26-31). It was that He offered us the gift of His Son, and we accepted Him. We responded to God's authority, to His mercy. That offer was available to all. The fact that so many - in heaven and on earth - have chosen to cling to their own arrogance instead of clinging to the Living God does not negate His mercy or our humility. For all parties, this is a matter of individual choice. The best I can do is to point to Satan's example (cf. SR #1 again): when he became enamored of himself, this arrogance corrupted his heart, his perspective and his judgment. We know that fighting God, that spurning His only offer of salvation, Jesus Christ, is utter madness, but pride is (or soon begets) a madness that reduces God in ones thoughts - utter insanity - below oneself. We either choose self or God. Thanks be to Him for those who have made the right choice.
You might also have a look at these links:
The Plan of God
Free-Will Faith in the Plan of God.
Satan and the Existence of Evil.
The Cross, Sin, and the Devil in God's Plan.
Why does the devil have access to God while man cannot stand in His presence?
Is the devil "mad" to oppose God?
Yours in Christ,