In the "betrayal" scene, Sauron (and the enemy together) had just been cast down. He's at his weakest, they are fleeing.
And an elf stabs him with a magical artifact (the crown).
This doesn't defeat Sauron - it just wounds him seriously (kills the body Sauron is in, not the spirit), and it...