In the final act, Dominic captures the Russo family and plans to turn every mortal into a magical bead. He frames Alex for the crime, leading to her being arrested by the Wizard Council. After escaping with the help of Mason, Alex confronts her evil self on the Leaning Tower of Pisa.
The twist occurs when Alex realizes she cannot defeat Evil Alex with brute force because Evil Alex is her. To win, Alex must renounce her magic, effectively 'killing' the magical bond that sustains the evil doppelgänger. By giving up her powers, she destroys the machine and the twin. However, the Wizard Council restores her powers at the end, recognizing that her willingness to sacrifice her most prized possession (her magic) to save humanity was the ultimate proof of the maturity she had been seeking all along.