To Where and Back again

At the Castle of Friendship, Twilight Sparkle, Starlight Glimmer, and Spike carry some old boxes of books into storage. When Twilight thanks the two for their help, Starlight conveys her own thanks to Twilight for all she has taught her about the magic of friendship. As Twilight expresses how proud she is to call Starlight her pupil, Spike looks out the castle window and sees something approaching from the sky. Moments later, mailpony Derpy comes crashing in.
She delivers a letter to Starlight Glimmer from her old village. Twilight and Spike believe the town is in danger or upset with Starlight, but Starlight says it is much worse:
They've invited me to the annual Sunset Festival!"
— Starlight Glimmer
Starlight's nightmare
Princess Luna "because you need me to be" S6E25
Princess Luna offers her support to Starlight.
The next day, Starlight travels to her old village, where Double Diamond, Party Favor, Night Glider, Sugar Belle, and the other villagers have decorated for the Sunset Festival. When Starlight greets them, they cruelly turn her away and tear up her festival invitation. As the villagers start to laugh at her, Starlight shuts her eyes. When she reopens them, day has turned to night, and everyone around her has vanished. Just then, Princess Luna appears through the fog and reveals that Starlight is only having a dream.
Realizing she is more nervous about the festival than she thought, Starlight asks Luna what she should do. Luna tells Starlight that the Mane Six have helped her time and time again and suggests that she share her concerns with them.
Trixie putting a hoof around Starlight Glimmer S6E25
When in doubt, count on a great and powerful friend.
The next morning, the Mane Six and Spike are gathered in the castle throne room, and Starlight confides in them her worries about going to the Sunset Festival, questioning how much they have truly forgiven her and how much she has really changed. The ponies assure Starlight that she has changed for the better and that she would not have been invited to the Sunset Festival if the villagers did not believe the same.
Twilight suggests that Starlight bring a friend along to help make things easier. Though Twilight subtly hints that Starlight bring her along, Starlight instead chooses to bring along Trixie, much to Trixie's delight and Twilight's disappointment.
The Sunset Festival
Starlight Glimmer cowers on the ground S6E25
Starlight fears falling back into her old leadership role.
Some time later, Starlight and Trixie arrive on the outskirts of Starlight's old village. Starlight hopes to enjoy the festival without attracting too much attention, and Trixie promises to drag her out of there if she gets too uncomfortable. As they enter the town, the villagers greet Starlight much more positively than they did in her nightmare. However, they quickly overwhelm her with questions about where she is living and how long she will be staying.
Surrounded by ponies on all sides, the panicked Starlight pushes them away with a magical force field and cowers to the ground in fear. Recognizing her friend's discomfort, Trixie spirits them away from the town with a smoke bomb. As they return to Ponyville, Starlight feels ashamed about how she left, but Trixie tells her that everyone makes mistakes—even Trixie herself.
Invasion of the pony snatchers
Rainbow Changeling whips her tail at Starlight and Trixie S6E25
Something's rotten in the town of Ponyville...
Back in Ponyville, Starlight Glimmer meets up with some of her friends, but she notices them acting strangely: Pinkie Pie does not know Starlight's name or where she went, Applejack and Rarity laugh at her misfortune, and Rainbow Dash and Fluttershy whisper to the others in secret. When she goes to speak to Twilight about it at the castle, Spike almost refuses her entry, and when she explains to Twilight what happened at the village, Twilight advises her to "cut her losses" and never go back there. Starlight is considerably surprised to hear such advice from the princess of friendship.
That night, Starlight Glimmer has another dream about her old village. The villagers she encounters all ignore her, and Twilight appears with her friends to harshly scold Starlight for disobeying her orders. As Starlight senses there is something wrong, the Mane Six vanish into thin air. Princess Luna appears out of the moon, but something appears to hold her back. She informs Starlight Glimmer that the changelings have returned and captured her and Princess Celestia. She tells Starlight to find help but to also be careful of who she trusts. As Luna is detained by the changelings, Starlight is forcibly awakened from her dream.
"They're back!"
— Starlight Glimmer
Changeling "...and have taken control of the castle!" S6E25
Changelings take control of the Castle of Friendship.
Starlight sneaks out of the castle and goes to wake up Trixie in her nearby cart. After determining that Trixie is not a changeling herself, Starlight brings her up to speed on the situation. They sneak back to the castle and find the Mane Six and Spike—changelings in disguise—in the throne room using a magical scarab beetle array to communicate with Queen Chrysalis. The changeling drones report to their queen they have taken the Mane Six's places and seized control of the castle. Chrysalis reports that Celestia and Luna have also been replaced in Canterlot.
Having thought too small the last time she attempted to take over Equestria, Chrysalis has organized a systematic capture of all of the most important ponies in the land, leaving no one left to stop the changelings from taking over. When their communication ends, Starlight nearly gives herself and Trixie away with a creak in the throne room doorway, but they avoid being discovered with Starlight's invisibility spell.
Mounting a rescue

Thorax arrives to help!
Starlight teleports herself and Trixie back to Trixie's wagon, and Trixie feels unqualified to deal with such a situation as a changeling invasion. With Twilight, Celestia, and Luna captured, Starlight suggests seeking the help of Princess Cadance and Shining Armor in the Crystal Empire, but Thorax appears to inform them that Cadance, Shining Armor, and Flurry Heart have all been taken prisoner as well.
Trixie and Thorax look to Starlight Glimmer for guidance, but Starlight is unsure of what to do. As they are certain there is no one around with powerful magic to help them, Discord appears.
"Well, isn't this quite the combination of secondary characters?"
— Discord
Discord knitting a crochet rabbit S6E25
With Discord, Starlight's "unlikely team of heroes" is complete.
After determining that Discord isn't a changeling, Starlight informs him that the Mane Six and all of the royals of Equestria have been taken prisoner. Discord is furious to learn that Fluttershy has been taken, and he transports the four of them to the outskirts of the Changeling Kingdom, where Queen Chrysalis' castle lies.