Princess Luna, formerly known as Nightmare Moon, is a Pegasus unicorn and the younger sister of Princess Celestia, and is the main antagonist (as Nightmare Moon) of the first two episodes of My Little Pony: Friendship is Magic. Luna is restored back to her former self through the magic of the Elements of Harmony and returns to rule Equestria alongside her older sister.
Thousands of years ago, Princess Luna had ruled Equestria with her big sister, Celestia, but had eventually grown jealous of her duties of the night because the ponies slept and shunned it. This went on until she eventually refused to lower the moon to make way for the dawn. Eventually, this jealousy turned her into the evil Nightmare Moon. Celestia was then forced to banish her into the moon, claiming control of both the sun and the moon.
Return and Redemption
Thousands of years later, It was written that Nightmare Moon (Known also as The Mare in The Moon) would return on the thousandth Summer Sun Celebration with the aid of the stars. And it was all true. Nightmare Moon eventually returned, and planned to declare eternal night. But she was soon stopped by Celestia's faithful student, Twilight Sparkle, and her 5 new friends with the Elements of Harmony, converting her back into Princess Luna. After this, Celestia gives her a chance to redeem herself, and she remorsefully accepts.
Role in the series
According to the Fanfiction series, the Villain League intended to get Princess Luna back into Nightmare Moon for their own nefarious purposes. Also, in the Chronicles series, Batula had a crush on her, and intended to turn her back into Nightmare Moon so he and she could rule the night together. Luna also knows the Shell Lodge after the events of the Fanfiction episode. And like her big sister, she was once a chaotic creature created by Discord called a Serpicorn. But when understanding the ways of the ponies' joy, love and hope, they both become beautiful Alicorns.