In the first episode's prologue, a storybook-like narrative portrays the elder unicorn princess (on the left) and her younger sister. The elder sister is later named Princess Celestia. Celestia is introduced in the prologue of the first episode, depicted in a series of medieval-style drawings with a narration that says "two regal sisters who ruled together and created harmony for all the land," and that "the elder used her unicorn powers to raise the sun at dawn. The younger brought out the moon to begin the night."
The narration continues: their subjects, the ponies, played in the day but "shunned" the night and slept through it, which made the younger "unicorn" grow bitter, eventually refusing to lower the moon to make way for the dawn. Her bitterness transformed her into a "wicked mare of darkness," Nightmare Moon. The elder sister reluctantly harnessed the power of the Elements of Harmony and banished her "in" the moon for 1,000 years, maintaining harmony in Equestria by taking responsibility for both sun and moon.
Following the prologue, Twilight Sparkle reads of a prophecy that states that "on the longest day of the thousandth year the stars will aid in The Mare in the Moon's escape, and she will bring about nighttime eternal," though Spike dismisses it as "an old ponies' tale." The day of Nightmare Moon's return is also the 1,000 year anniversary of the Summer Sun Celebration, so Princess Celestia sends Twilight to oversee the celebration's preparations, which are being held in Ponyville, and encourages Twilight to "stop reading those dusty old books" and make some friends, much to Twilight's surprise.
The events of the first and second episodes revolve around Twilight Sparkle and her new friends' attempt to defeat Nightmare Moon by finding and using the Elements of Harmony, while Nightmare Moon tries to stop them in various ways. Celestia is expected to appear at Ponyville's pavilion, but she goes missing and Nightmare Moon appears in her place instead. Celestia doesn't reappear until Nightmare Moon is defeated and transformed back into Princess Luna at the end of Friendship is Magic, part 2|the second episode by Twilight and her friends. Princess Celestia offers her younger sister a chance to rule by her side again, and she accepts.