In the year 2061, Petra Peña sits outside with her grandmother Lita. Halley’s Comet, which usually goes past Earth roughly every 75 years, will collide with the planet and eradicate all life in just a few days. The U.S. government has arranged for three spaceships to bring passengers to start a new world on Sagan, a faraway planet that’s supposed to be hospitable to human life. The first ship will carry farmers, builders, and other tradespeople; the second ship will carry scientists; and the third ship will carry politicians and leaders. Because her parents are both scientists, Petra and her brother Javier have been given spots on the second ship—but Lita is too old to make the eligibility cutoff. Petra is upset about leaving her grandmother behind, but Lita comforts her with a cuento, or story. In Lita’s cuento, the sun and the earth have a child, Fire Snake. In a bid to challenge his father, Fire Snake becomes blind and finds himself unable to return to Earth. Now, he tries again to reunite with his mother every 75 years, just like the comet passing the Earth. Lita tells Petra that the comet’s collision is just Fire Snake finding his way back home at last. She gives Petra a sun-shaped pendant and encourages her to keep her memory alive in her heart while forging her way as a storyteller in her own right.
As they wait to board the second spaceship, Petra and her parents worry that if the administrators on the ship find out that her vision is impaired, she’ll be kicked off the craft. They manage to board, however, and they soon meet Ben, a Monitor (a person who has volunteered to spend the rest of their life watching over the humans chosen to board the ships). Ben has been assigned to guard the ship’s children in their stasis pods. He puts Javier and Petra into their pods—but when he triggers Petra’s stasis, it doesn’t work. Her mind stays alert and awake while her body is completely immobilized. Unable to tell anyone what has happened, Petra listens as her parents leave for their own stasis chamber and an angry mob of people left behind on Earth starts to attack the ships that are still on the ground. Petra’s ship quickly takes off, following the first ship into space. The third, however, isn’t so lucky, and the mob successfully sabotages it. As Ben grieves the passengers of the third ship, Petra hears the stern Lead Monitor enter the room and tell him that without politicians, the opportunity has arisen for a new world order: one that wipes away the individual identities, histories, and memories that cause conflict in favor of a peaceful “Collective.”
After the Lead Monitor leaves, Ben starts reading aloud to the children in their pods. As a birthday gift, he uploads a massive library of Earth books into Petra’s mind. Petra finally drifts into unconsciousness. When she wakes, she hears a scuffle as people storm the room and kill Ben, who is frantically pressing buttons outside Petra’s pod. After Ben dies, the people resolve to wipe all of Petra’s memories for good. Petra drifts off again.
When Petra reemerges, the year is 2432. Over and over, two sentences have been playing in her head: “I am Zeta-1, Expert in botany and geology. I am here to serve the Collective.” A stiff woman called the Chancellor and her assistant Crick are removing the children from their pods. Listening to them talk to Suma, another girl on board, Petra quickly deduces that the children have been reprogrammed to forget their identities and dedicate themselves blindly to the Collective. Suma cries out for her mother, which prompts the Chancellor to put her back in stasis for further reprogramming. When it’s her turn, Petra successfully pretends that her own reprogramming has worked. After discussing their intention to use the children’s scientific knowledge to make sure Sagan is safe for settlement, the Chancellor and Crick leave the children to sleep. The other children in the room are called Zeta-3, which Petra mentally changes to “Rubio,” and Zeta-4.
The next day, Petra meets the Chancellor’s mischievous son, Voxy. He smiles at the Zetas, but the Chancellor enters the room and leads the Zetas to the cafeteria before the interaction goes further. There, the Chancellor announces that the Zetas will go on expeditions to evaluate Sagan’s atmosphere and that they’ll bring a nervous man named Len with them. Petra, hoping to find her parents and Javier, breaks free of the crowd and looks for their pods. Eventually, she finds them, but she sees that they’re empty. Labels on the pod say that Petra’s parents were “purged” decades ago. Devastated, Petra concludes that Javier, her mother, and her father are all dead.
Back in the Zetas’ quarters, Zeta-4 has a nightmare and cries out for her mother. Petra realizes that the other Zetas’ memories must not be as buried as she thought. She wakes Zeta-4 and tells her not to tell anyone about her dream. To lull her back to sleep, she agrees to tell her a cuento. By the end, Rubio has awoken and is listening eagerly. Petra makes them both promise to keep the stories a secret. In her head, she starts calling Zeta-4 “Feathers.” In the morning, the Zetas go on their first expedition to Sagan. The Chancellor tasks Petra with collecting information about Sagan’s plant life in order to develop a defoliator. When the group lands on Sagan, Petra finds a cave where she could hide and make an escape, but she realizes that she cares too much about Feathers and Rubio to leave them behind. Instead, she decides to figure out a way to get them to follow her back to the cave so they can all escape together. Back on the shuttle, Len suddenly breaks out in boils. Petra acts quickly to relieve his pain by dumping water from the Zetas’ flasks on his skin, but they’re unable to help him further. When they arrive back at the ship, the Chancellor thanks Petra for her help but warns her not to put her own “value” in danger again.
After the following day’s expedition, the Zetas find Suma asleep in their quarters: the Chancellor and Crick have successfully reprogrammed her as Zeta-2. Feathers and Rubio invite her to listen to Petra’s nightly cuento. After the others have fallen asleep, Petra wanders the ship in search of food to steal for her cave. In the teen stasis room by the labs, she encounters an old man who introduces himself as Epsilon-5. The ship’s only remaining scientific Expert, he’s supposed to work with Petra on the defoliator. They strike up a friendly conversation until the Chancellor enters the room and, seeing them together, reiterates their mission. That night, Petra cries out in her sleep and wakes to find Voxy shaking her. He confesses that he has been listening in on all of Petra’s nightly cuentos and falling asleep in their room. Voxy offers to show Petra a paper book relic on the ship as long as she agrees to continue telling him cuentos in exchange. He leads her to his own quarters, which are next to the Chancellor’s. Behind his bed, turn a tiny handle to discover a secret room full of seeds and Earth relics from the ship’s original passengers. Petra finds her sun pendant, which she had to take off before entering stasis, and the book that Voxy described, which once belonged to Javier. After she sneaks out of the room, she overhears the Chancellor in a meeting and discovers that the ship leadership has reason to believe that the first ship has already established a settlement on Sagan successfully.
In the morning, the Zetas discuss Petra’s last cuento, and Petra realizes that their memories are starting to return. In the lab, Petra starts to develop the defoliator. When Epsilon-5 enters the lab, he mentions that the Chancellor asked him to create an airborne poison powerful enough to wipe out animal populations, but which is also temporary, so that the planet can be habitable afterward. Petra realizes that the Chancellor is planning to kill the humans from the first ship that settled on Sagan already. To her even greater shock, when Epsilon-5 takes off his gloves, Petra sees a familiar birthmark on his hand and realizes that he is Javier, who was removed from his pod over 75 years ago and has aged beyond her recognition. Immediately, Petra decides to bring Javier with her in her escape. She convinces Javier and the Chancellor to hand over development of the toxin to her and secretly strives to dilute it with oxygen and stasis gel as quickly as possible.
Petra rushes back to the secret room and steals her family’s relics, clothes for the Zetas, and a photo book from Suma’s childhood. She finds her way to Javier’s room and reads him the book from his past. By the end of it, Javier is in tears, and he recognizes Petra and remembers his past. He agrees to help Petra with her escape plan at once. Javier leaves to go get the Zetas, but when he comes back with the Chancellor instead, Petra believes that he has betrayed her. The Chancellor and Crick force Petra into a pod and start to reprogram her. In her unconscious mind, Petra sees Ben inside a great library. Ben tells her that he has saved Earth’s stories inside her mind as his final act. When she wakes up with her memories intact, Javier apologizes and explains that he had to pretend to betray her so that he could save her when he realized that the Chancellor suspected her. The Zetas proceed to the shuttle to make their escape. When they arrive, Javier hugs Petra goodbye and tells her to go on without him. Although she screams and pleads with him, he succeeds in launching their shuttle while he says behind on the ship to give them a fighting chance of getting away. When the Chancellor discovers what he’s done, she will surely kill him, but he sacrifices himself out of love for Petra.
The shuttle lands, and Petra realizes that Voxy is a stowaway on the shuttle. He witnessed what the Chancellor did to Petra and wants to escape the Collective with her. Petra agrees to let him come, and the group sets out for the cave. There, Petra sees that animals have eaten the food she stashed, so she decides that they should go on to try to find the settlement instead. Suma protests and tries to go back, so Petra gives her the photobook and helps her remember her past. As they approach the settlement, drones from the ship appear and spray the area with the toxin. The group hides and avoids it, but Petra mourns the people of the settlement who may have died if her dilution failed. While they wait for the toxin to disperse, Petra tells the group a cuento about Fire Snake destroying Earth and following the humans on it to Sagan to watch over them from a distance. Rubio notes that he can smell smoke. The group follows the smell and finds the settlement, active and alive. Petra realizes that Javier managed to dilute the toxin properly as his last sacrifice for mankind. Knowing that she’s found a new home at last, she rejoices.