Starswirl's last spell swapped the destinies of the bearers of the Elements of Harmony. Now, over a thousand years later, the spell is reversed by Twilight Sparkle.
Celestia decides to attempt to reform Discord, so she taps a pony with a similar background for the job. ("Keep Calm and Flutter On" as it occurs in the Petriculture AU.)