A Malthusian catastrophe on Earth has been averted by the invention of teleportation, called the "Ramsbotham jump", which is used to send Earth's excess population to colonize other planets. However, the costs of operating the device mean that the colonies are isolated from Earth until they can produce something to justify two-way trade. Because modern technology requires a supporting infrastructure, more primitive methods are employed— for example, horses instead of tractors.
Rod Walker is a high school student who dreams of becoming a professional colonist. The final test of his Advanced Survival class is to stay alive on an unfamiliar planet for between two and ten days. Students may team up and equip themselves with whatever gear they can carry, but are otherwise completely on their own. They are told only that the challenges are neither insurmountable nor unreasonable. On test day, each student walks through the Ramsbotham portal and finds him or herself alone on a strange planet, though reasonably close to the pickup point. Rod, acting on his older sister's advice, takes hunting knives and basic survival gear rather than high-tech weaponry, on the grounds that the latter could make him over-confident. The last advice the students receive is to "watch out for stobor."
On the second day, Rod is ambushed and knocked unconscious by a thief. When he wakes up, all he has left is a spare knife hidden under a bandage. In his desperate concentration on survival, he loses track of time. Eventually he teams up with Jacqueline "Jack" Daudet, a student from another class whom he initially mistakes for a male. When she tells him that more than ten days have elapsed without contact, he realizes that they are stranded.
They start recruiting others for the long haul and Rod becomes the de facto leader of a community that eventually grows to around 75 people. Rod has no taste for politics or administration, and is happy to have Grant Cowper, an older college student and born politician, elected mayor. Grant proves to be much better at talking than getting things done. Despite disagreeing with many of Grant's policies, Rod supports him. Grant ignores Rod's warning that they are living in a dangerously hard-to-defend location and that they should move to a cave system he has found. When a species previously thought harmless suddenly changes its behavior and stampedes through their camp, the settlement is devastated and Grant is killed. Rod is put back in charge.
Heinlein tracks the social development of this community of educated Westerners deprived of technology, followed by its abrupt dissolution when contact with Earth is reestablished. After nearly two years of isolation, the culture shock experienced by the survivors highlights for them and the reader the pain and uncertainty of becoming an adult, by reversing the process abruptly—Each of the students goes from being a self-responsible member of an autonomous community back to being regarded as a youth.
All of the students go back willingly except for Rod, who has great difficulty reverting from the status of head of a small, but sovereign state to a teenager casually brushed aside by the adult rescuers. However, his teacher (and now brother-in-law) and his sister persuade him to change his mind. His teacher also informs Rod that his warning against "stobor" ("robots" spelled backwards) was just a way of personalizing the dangers of an unknown planet - to instill fear and caution in the students.
Years later, Rod is briefly depicted accomplishing his heart's desire; the novel's ending finds him preparing to lead a formal colonization party to another planet.