The book is set in a fictional universe where humanity needs to defend itself against an alien race of insect-like creatures.
It offers a set of allegorical insights into matters such as human tolerance for violence towards races considered as 'alien', the effects of military indoctrination, and the depersonalization of warfare in a simulated 'computer-game battlefield'.
Then at the age of six he was taken away from his home, where he had suffered at the hands of the jealous and physically superior Peter, but also where he had enjoyed the unconditional love of his sister Valentine. Separation from his parents was a mixed blessing; they loved Ender but his presence caused tension in the household, as every step Ender took reminded them of the conflict between their religion (which they hid from society) and their pledges against having more than two children. Ender was sent to orbital Battle School that trained similar prodigies. He received the same education as other children, but the military had recognized him as their best bet for a supreme commander and often bent or broke its own rules to make sure Ender had not only the necessary technical skills, but also the right character for their ends. Specifically, Ender was conditioned to be entirely self-sufficient and reliant on no one from a very young age. To this end, Ender was exposed to great emotional and mental anguish and even physical danger. The administration was forbidden from taking action to protect his safety in order to guarantee that Ender would never look to anybody else for help.
Ender breezed through academics, his main interest being the centerpiece of the school: a team-based three-dimensional laser tag in the zero-g Battle Room. He became first a masterful player, then a masterful strategist, and was eventually assigned command of Dragon Army, which he molded from a group of untested and unwanted students to the most successful army in the history of the school. Despite the manipulation from the school's brass, he gathered a close-knit group of friends and acquaintances (referred to in later books as his "jeesh" or personal coterie): namely, Julian "Bean" Delphiki, Alai, Shen, Petra Arkanian, Dink Meeker, Crazy Tom, Hot Soup, Fly Molo, Vlad, Dumper, and Carn Carby.
After graduating several years ahead of time, he was transferred to Command School on Eros. There he trained in interstellar fleet combat with holographic simulators. After Ender mastered the game under ordinary conditions, it was changed from one with direct control of ships to one where he relayed commands to others - his friends and associates from Battle School. He was also pitted against humanity's previous savior from the Buggers: his own mentor, the legendary commander Mazer Rackham.
With his trusted companions he took on a grueling series of simulated battles of constantly increasing difficulty, and though they won every battle, the mounting pressure pushed Ender to the edge of sanity. The final battle was against apparently impossible odds above a simulated planet, and in response to this ridiculous scenario, Ender finally snapped. He destroyed the planet in the hopes of flunking out for savagery and excessive risk-taking. Not until after the pandemonium that followed was he told that it was not actually a simulation: Instead of taking on Rackham in what they had thought was a long series of simulations, he and his jeesh had been issuing real-time orders to ships dispatched at relativistic speeds decades before. The final battle in fact consisted of the destruction of the Bugger home world and the apparent eradication of the Bugger species, resulting in Ender's rise to world adulation. Ender, however, reacted with guilt and anguish for having unknowingly committed xenocide, as well as with anger for allowing the military to use him as a tool.
In the wake of the war, Ender's sister Valentine informed him that he would never be allowed to return to Earth due to her own actions in an effort to protect him from his brother, who was becoming a major political force on Earth. He instead journeyed with her to one of the colonies being established on the now-abandoned Bugger worlds. Once there, he discovered a fertilized pupa of a Queen Egg from the Buggers, hidden in a place that the Buggers had conditioned him to find via an interactive training program during his years in the Battle School. The egg was capable of continuing the Bugger race. Through rudimentary telepathic communication with the Queen, he learned what he had begun to suspect before the war's end: that the entire conflict had been a mistake, the result of lack of communication between the two warring species. He further learned from the Queen that the Buggers had felt terrible regret for having mistakenly fought humans and that they had forgiven Ender for their own deaths even as he orchestrated their destruction. Empathizing with the Queen, Ender promised to find her a home to grow where the Buggers would not be annihilated by the humans.
To foster this eventual rebirth, Ender wrote a book called "The Hive Queen" which told the story of the war and life from the Formic perspective. Ender used the pseudonym "Speaker for the Dead" to author it. When his brother Peter, who had advanced to the position of Hegemon of Earth, contacted him, having realized Ender was the writer, the Speaker for the Dead wrote a second novel, "The Hegemon", a human parallel to the first book. The two were combined by popular culture, eventually becoming one of the founding texts of a quasi-religious practice on the colonies of Earth. After writing the book, Ender and Valentine departed in a ship in an attempt to find a planet to allow the Queen to grow, and call his new home.
He departs for the planet Lusitania, where a request has been sent out for a speaker to speak on behalf of a researcher who died from contact with the planet's indigenous species. By the time he arrives at the planet 22 years later (relativity having aged him only slightly; less than two weeks) he finds that the original call has been rescinded. However two other calls have gone out for more recent deaths. Ender discovers that both calls originated from the same 'family'; the first from the Novinha's daughter Ela requesting someone speak for the death of Novinha's husband Marcos, and the second from her eldest son Miro, who has asked for a speaker for the researcher Libo, who died similarly to the older xenologer.
Ender begins to investigate the Marcos figure first and so has frequent contact with Novinha's family. His honest and open approach endears him to the elder children as a father figure; it's discovered very easily that Marcos was very abusive to his wife and children. With the help of Jane and his connection with the children, he discovers multiple secrets that have been hidden away for years. However, in the process of speaking with the local religious group, the Children of the Mind monastic order on the planet, he tires of Jane's semi-sarcastic commentary and turns off his connection to her, something he has never done before. During this time, Jane, without consulting Ender, sends incriminating reports to the intersteller authorities who order the arrest of Miro and Ouanda, the researchers and lovers who have been investigating the piggies most recently, and cancel the colony's charter, something which forces the colonists to eventually rely on Ender for guidance.
Ender meanwhile has been receiving pressure from the Queen's pupa to allow her to settle on this world because she has been in telepathic contact with another race. Ender assumes this race is the piggies, although the bipedal life forms that are the primary contacts of Miro and Ouanda seem very simple and not telepathic at all. After the sanctions are put in place, he gets Miro and Ouanda to allow him to visit the piggies, who have been asking to meet him, the 'original Speaker' (a claim Miro and Ouanda have been dismissing as a misunderstanding). Ender destroys many of the assumptions of the researchers when he not only admits to being the original Speaker, but has the piggies demonstrate that the trees they grow from the corpses of those who have been ritually killed are in fact their third stage of life which allows them to reproduce. The ritual killings that were done of the two xenologers were misunderstandings by the piggies, who thought the humans reproduced in a similar fashion.
After those revelations, he proceeds to do his Speaking for Marcos, where he reveals many secrets hitherto buried mostly by Novinha. Foremost among them is that Marcos was incapable of having children, and Novinha's children are all in fact the children of Libo. This is devastating news to Miro, because it means his lover Ouanda is in fact his half-sister. It is around this time that the sanctions from the Intergalactic Congress are learned of. Miro attempts to escape by climbing over the quarantine fence and does massive neurological damage to himself. Ender recommends to the colony that they declare themselves in rebellion, and reestablishes contact with Jane who masks their ansible signal.
By the end of the book, he has entered into the beginnings of a relationship with Novinha and his sister Valentine has agreed to come to the colony. He has also planted the Queen's pupa on a far side of the planet.
Eventually research ordered by the government on another planet, Path, leads a young genius girl to deduce the existence of Jane, who is inextricably tied to the ansible system. Jane reveals herself to the girl in an effort to prevent her from informing the authorities by telling her that the OCD her people suffer from was governmentally ordered and orchestrated, a plea which the girl's father and handmaiden agree with. However, the report to the authorities is dispatched regardless and the government enacts a plan to temporarily deactivate the ansible network to purge Jane from the system. The father agrees to help with the Descolada problem regardless of his daughter's actions, in exchange for a cure for the pervasive OCD that plagues them. The Lusitanian researchers agree, but though a cure for both is designed, it proves impossible to synthesize; they can't cure the OCD without removing the genius as well, and the counter for the descolada simply won't form. Meanwhile, putting together facts about Jane's origins, the ansible, and philotes they deduce that Jane has the power to take any object she knows about in great detail and pull it outside the known universe, an area where conscious thought has a lot more power than anything else.
Ender goes on the first test flight because Jane's existence was a direct result of his time at the Battle School, where the buggers established a connection with him via a computer simulation game, therefore Jane is most likely to be able to keep Ender's form in her mind. Since Ender has all but passed Jane off to Miro at this point, due to the previous misunderstanding in Speaker, he must go as well. Ela goes because she is the only one with enough knowledge to produce the needed viruses. The test flight occurs with unexpected side-effects. Ela produces the new viruses, but Miro also gives himself a new body, undamaged unlike his old one. Ender, however, inadvertently creates copies of his brother and sister from his memories. They are more based on those memories than reality, therefore Valentine is very soft and loving, and Peter is almost pure evil and malice. Horrified at what he has created, Ender removes himself from further efforts, as they will all need to involve the instantaneous travel Jane can do by moving things outside and Ender will not risk creating more things like his pseudo-siblings.