@luna the great!
That’s what I like to hear! (don’t say I didn’t warn you!)
First, it’s important to note that Sunset’s falling-out with Celestia was never made public, as Celestia considered it to be a personal matter.
While on her quest for the knowledge that Celestia “denied” her, Sunset still makes sure to keep up with current events. She hears about Celestia taking on a new student (Twilight) very soon after it happens. At first, Sunset doesn’t think anything of Twilight. After all, she’s just some random pony that Celestia decided to tutor, right? She’s nothing.
However, after Twilight rediscovers the elements of harmony and redeems Princess Luna, THAT gets Sunset’s attention. She starts paying much closer attention to Twilight and the events that she’s involved in, and her focus only increases as more stuff happens: Discord, the Changeling Invasion of Canterlot, the Changeling attack on Ponyville and Twilight’s subsequent duel with Chrysalis, The Crystal Empire, Nightmarity, and of course Twilight’s ascension and coronation.
As I said before, Twilight becoming a princess is what sends Sunset over the edge. She starts making her plans in earnest, and realizes that as powerful as she is, she’ll need plenty of loyal followers to carry them out. Luckily, she knows exactly where to find them.
She travels to the castle where Twilight and Chrysalis had their duel on the night of the Secretariat comet. Chrysalis and the changelings are still trapped inside, and have grown weak from a lack of food. Sunset destroys the traps that had imprisoned the changelings and challenges Chrysalis for leadership of the swarm. Chrysalis accepts the challenge, but since she’s severely weakened by starvation and is still nursing wounds from her fight with Twilight, Sunset beats her handily.
Sunset then addresses the swarm, telling them that if they swear their undying loyalty to her, she’ll help them reach their full potential and will never let them go hungry. The entire swarm (sans Chryssy) immediately accepts. Sunset imprisons Chrysalis and keeps her close at hoof, figuring that if anything goes wrong with her using changelings, Chrysalis can be the scapegoat.
After that, Sunset uses her linked journal to send a message to Celestia in the hopes of gaining an audience with her and Luna. Celestia, who of course has no idea of the depths that Sunset has sunk to, is overjoyed to finally get a chance at reconciling with her misbegotten pupil. So one night, Celestia meets Sunset for the first time in many years, and Luna meets her for the first time. It’s a trap, though. Sunset uses dark magic to catch both princesses entirely off guard and turn them to stone.
Twilight receives a letter that same night, and not through the usual dragonbreath mail. The letter is from “Celestia”, and warns her that she’s likely to be the target of an impending attack (or something. I admit, this is probably the weakest part of the story currently) and that she’ll have to leave Equestria at once for a few months. Transport is already arranged at the train station, and she’s not allowed to tell anyone of this. Guards will be dispatched to the library to collect Spike and the Elements of Harmony for safekeeping after she leaves. Seeing no reason to believe that this is a forgery (the letter looks absolutely authentic, royal seal and all), Twilight complies with its instructions.
The next morning, chaos erupts in Canterlot as two ponies wage a pitched battle all across the city with loads of witnesses. One of them is “Princess Twilight Sparkle”, who’s maniacally laughing and gloating that she’s killed Celestia and Luna and that all of her plans are coming to fruition. The other is Sunset Shimmer, who’s going out of her way to protect the citizens of Canterlot as she battles the mad princess. Eventually they fight to a standstill and “Twilight” runs off, swearing revenge.
This, of course, sends Canterlot into complete uproar, with Sunset at the center. Naturally the populace realizes that “Evil Twilight” might have been a changeling, but Sunset (who by this point has undergone and passed changeling tests) dismisses their suspicions, stating that “if she was fighting a changeling impersonating Twilight, she would know”. Meanwhile, Sunset has proven her identity as Celestia’s student by having Celestia’s school for gifted unicorns pull records on her enrollment and apprenticeship, which check out (and even if Celestia made a record of Sunset’s dismissal without making it public, Sunset probably thought about that beforehand and quietly destroyed any embarrassing records shortly before the coup). She explains her absence as Celestia sending her off to explore the world as advanced training, but that Celestia also had a way to alert Sunset in the event of her own death.
Since Equestria has lost all three of their princesses in one fell swoop (and Cadance is busy with the Crystal Empire), the issue of selecting a new leader is put front and center. Sunset becomes an obvious candidate, helped by Sunset revealing that Celestia had also taught her to raise the sun and moon (except not. she uses a spell to set Celestia and Luna’s sun and moon controlling spells to “autopilot” while they’re trapped in stone). And her public opinion only continues to rise the longer Twilight is gone, and more and more ponies start to accept the show that happened on the day of the coup as truth. And ponies that are heavily opposed to Sunset being princess soon have a complete change of heart on the matter (i.e. they’re replaced by changelings).
After being crowned the sole Princess of Equestria, Sunset pledges to protect the country and to bring Twilight Sparkle, The Deceiver Princess, to justice. There are some ponies who think that there’s foul play at work, and that Twilight might be innocent, but don’t listen to them! They’re “Deceivers of Harmony” who want nothing more than to bring ruin to Equestria!
Several months later, Twilight receives instructions to return to Equestria. And return she does… to a world gone crazy.