The real question is how or why any power could resist an omnipotent and omniscient god. Mind you, the god of scripture is neither omnipotent or omniscient.
The word omnipotent isn't meaningful if it's defined as having unlimited power. Power isn't meaningful unless it's finite in amount.
If God is all-powerful, that could mean that all the power there is belongs to God. If that's true then God is all there is: God is maybe entertaining himself with a puppet show where the puppets are his own fingers.
In order for there to be something separate from God, it would have to have its own power: separate from God's power... the power to defy God.
If God is all good, the only way to demonstrate that one is not just a puppet would be to sin.
The devil is the foundation of the idea of there being something separate from God. But the Devil is a primal thing: he's all bad, and therefore just a reflection of God... a partial solution to the problem of Pinochio becoming a real boy.
A human can sin. A human can defy God: a human is separate from God. A human can choose to do good. This is something the angels can't do. I think that's one way of looking at the core meaning of the devil.