The story is set in an alternate universe of My Little Pony: Friendship Is Magic with elements of Fallout influencing the story. An emerging energy crisis causes political tension between Equestria and the unnamed Zebra empire. Eventually, war was declared when a misunderstanding between zebras and ponies led to the massacre of Princess Lunas School for Gifted Unicorns in Littlehorn Valley. Lunas elder sister Princess Celestia abdicated the throne in shame, allowing Luna to ascend, which was blasphemous to the superstitious Zebras who viewed the stars as demons and saw Luna only as her evil counterpart Nightmare Moon.
Luna reforms the government, recruiting Celestias apprentice Twilight Sparkle and her five friends Applejack, Rarity, Fluttershy, Pinkie Pie, and Rainbow Dash, to form the Ministries, who control and influence much of the wartime Equestria. The war ends when Equestria is devastated by megaspell balefire bombs, creating the irradiated Wasteland. However, many Equestrian citizens survive by taking shelter in massive underground bunkers called Stables which are built to survive the apocalypse. The war saw the exodus of the pegasi race, who cover the sky in an endless cloud cover, forming the Grand Pegasus Enclave. Two-hundred years later, the Wasteland remains a barren, irradiated, hostile environment.
The story opens in Stable #2, home to a unicorn mare named Littlepip, an intelligent Pipbuck technician. Littlepip is given the Pipbuck of her idol Velvet Remedy, a unicorn who is the Stables popstar. However, Velvet leaves the Stable, prompting Littlepip to pursue her out into the Wasteland. She quickly becomes immersed in the Wastelands harsh reality, using her lock picking and hacking skills to survive.
She forms a small group of friends during her travels, including Velvet Remedy who becomes the groups Combat Medic and negotiator, loyal pegasus Calamity who is referred to as a Dashite after being exiled from the Enclave, and Steelhooves, a grim-minded Steel Ranger, a group of technology-hoarding soldiers founded by Applejack to protect Equestria. Velvet also adopts a balefire phoenix named Pyrelight. They are later joined by Xenith, an enslaved zebra who Littlepip rescues from Fillydelphia.
Littlepip starts to make a name for herself with her role as a Good Samaritan, while exploring the Wastelands past through memory orbs that contain preserved memories, particularly of the friendships of the Ministry Mares and their own fates. Pinkie Pie died in Manehattan, while Rainbow Dash and Fluttershy vanished. She makes a number of allies including the griffin mercenary Gawdyna Gawd Grimfeathers; the ghoul shopkeeper Ditzy Doo; Homage, a unicorn who poses as DJ Pon-3, and becomes Littlepips girlfriend; and the enigmatic Watcher who communicates with her through wandering surveillance Spritebots. Littlepip becomes addicted to the sensory-boosting drugs Party Time Mint-Als and learns the cruelties of the Wasteland when Monterey Jack, a pony she encountered shortly after leaving the Stable, is executed when she points out he attempted to rob her. This causes her to face her addiction and goes cold turkey.
Littlepip eventually meets Watcher in person, revealed to be the dragon Spike, assistant to Twilight Sparkle, but he slept through the apocalypse and searches for potential heroes from his remote cave. Spike shows Littlepip the Gardens of Equestria, a unique megaspell constructed by Twilight to magically restore life to Equestria using the magical Elements of Harmony, which require six ponies worthy enough to own them. Littlepip learns of Red Eye, a charismatic earth pony who originates from Stable 101 and has his own goals to restore Equestria. Littlepip sneaks into the slave city Fillydelphia with help from the Steel Rangers, making a deal with Red Eye to kill the Goddess, an ethereal being responsible for creating the alicorns that the protagonists encounter throughout the story. It is revealed that the Goddess is Trixie, who fell into a Super Serum designed by Twilight to turn ponies into alicorns, creating Unity, a collective of alicorns, forcefully transformed and enslaved to her will. The Goddess asks Littlepip to retrieve the necromantic Black Book from Canterlot.
After rescuing her Stable from invading Steel Rangers, Littlepip arranges for the occupants to be moved elsewhere, while Steelhooves forms Applejacks Rangers to uphold the factions original goal to protect Equestria. Steelhooves himself is actually named Applesnack, former boyfriend of Applejack, who is revealed to have survived the war in Stable 2. After meeting the Goddess and learn Twilight was forced into Unity, Littlepips group deal with the civil war between the Rangers and destroy a town secretly made up of cannibalistic ponies, shaking Littlepip's reputation as a hero. They travel to Canterlot, Xenith reuniting with her daughter Xephyr, while the others venture into the toxic city.
In Canterlot, the group retrieve the Black Book but break into the hub of the Ministry of Awesome, where Littlepip finds six memory orbs left for her by Pinkie Pie and Rainbow Dash. Viewing the orbs reveal numerous pieces of information - Rarity used the Black Books magic to split her soul and place them in a number of figurines based on her friends that Littlepip has been collecting. A drugged Pinkie Pie directly addresses Littlepip, informing her that Equestria can be saved on the Day of Sunshine and Rainbows. Steelhooves murdered Zecora, a zebra double agent working for Pinkie, leading to the end of his relationship with Applejack. Fluttershy gave megaspells to the zebras to make peace but they instead used them against Equestria, Rarity transporting Fluttershy to safety but was killed by the necromantic Pink Cloud unleashed on Canterlot.
Returning to the Goddess, Littlepip assassinates her using a balefire bomb smuggled in by Xenith as part of a planned gambit and destroys the Black Book. However, the Goddess destruction attracts the Enclave to descend. Steelhooves is decapitated by a Hellhound, and at his funeral, Littlepip witnesses the Enclave destroy Canterlot, and a disillusioned Velvet leaves the group after learning of Fluttershys involvement in the apocalypse.
Littlepip, Calamity, and Ditzy Doo go to Friendship City, meeting the Dashite pegasus Radar, who points out the Enclave actually came because of the break-in at the Ministry of Awesome, Rainbow Dash previously setting up security measures in the hope of meeting Littlepip as per Pinkies foresight. The Enclave destroys Friendship City to eliminate Radar. After rescuing New Appleloosa from the Enclave, and reuniting with Velvet, Littlepip plans to confront Red Eye, who is now operating from Stable 101 in the deadly Everfree Forest. Battling through the hostile forest, the group discover Fluttershy alive but transformed into a willow tree by Killing Joke plants. Littlepip confronts Red Eye alongside Calamitys brother Autumn Leaf, learning he intents on becoming a new god and assimilating both of them to transform into a proper alicorn. Autumn Leaf destroys the chamber with mind-controlled Hellhounds and Red Eye dies, Littlepip shooting Autumn Leaf dead to escape.
Littlepip decides to bring the sun back to Equestria by taking control of the Single Pegasus Project, a weather-controlling system operated by a singular ponys mind. In an elaborate plan, many of Littlepips friends and allies defeat Red Eyes forces and the Enclave whilst Littlepip accesses the control hub of the S.P.P. She meets Princess Celestia, who tried to take control of the weather but was trapped in the computer mainframe thanks to Rainbow Dashs tampering. Littlepip takes control of the S.P.P., clearing the cloud cover across the Wasteland. Equestria becomes a republic, whilst Velvet and the alicorns form the Followers of the Apocalypse to help those in need.
In the epilogue, from a revived Fluttershys point of view, the Gardens of Equestria has been activated, Equestria has been restored to normality, and Littlepip is a famous hero called the Lightbringer.