In Orson Scott Card's novel "Ender's Game," a child prodigy named Ender Wiggin is recruited to save the Earth from an alien attack. Ender enrolls in Battle School on a distant space ship, where he begins participating in simulated battles against the invading "buggers."
Ender is recruited by Colonel Graff of the International Fleet, and he leaves his brother Peter and sister Valentine behind. Peter's jealousy of Ender drives him to take over Earth while Ender is gone.
At Battle School, Ender distinguishes himself as a highly intelligent and strategic leader. He rises through the military ranks and soon begins to lead his own squadron. In simulated battles, Ender's squadron defeats enemies despite overwhelming odds. Some members of the military, including commander Bonzo Madrid, are jealous of Ender's abilities, going as far as attacking him.
Eventually, Colonel Graff brings Ender to Eros, the home of the International Fleet command. There, Ender participates in more simulated battles of increasing difficulty. After a massive battle with heavy losses, Ender learns that the battles were not simulated, and that he actually destroyed the buggers.
After his victory, Ender departs with Valentine to populate the planets the buggers left behind. He finds a pupa containing a new queen, and realizes the buggers did not wish to fight the humans.