The future society in Ender's Game has been attacked by the Buggers, intelligent space-faring insectoid aliens. They managed, through luck, to defeat two attacks, but because of the enormous number of Buggers, they know they cannot defend against a third. Instead, they go on the offensive, and decide to create a military leader who will not be defeated. By gathering and testing the smartest children in the world, they are able to find one who will become that leader: Ender. The military takes him from his family, puts him in Battle School, and places harder and harder obstacles in front of him, making him stronger and more intelligent, but also more depressed and angry. By the end, when Ender finds out that he was literally tricked into taking the actions that destroyed the Bugger homeworld, he is so depressed by events that he doesn't want to keep living; it is only the slow growth of societal intelligence from his sister's books and his discovery of the Bugger Queen egg that give him reason to live. Society uses him for a purpose, not caring what happens later; Ender takes that use and makes it his own, creating a destiny for himself out of the ashes of destruction.
In times of great stress, such as those put upon Earth in the aftermath of the Bugger Wars in "Ender's Game," society needs great leaders. If they do not exist they must be created, as is the case in breeding Ender Wiggin. Ender's entire existance comes from society seeking an end to this alien threat of invasion.
Ender understands the circumstances of his birth and the threat that still looms over Earth. At times he reacts violently to his calculated training, wanting nothing else than to be an accepted member by his peers. But at other times he puts these emotions aside with laser sharp focus and strives to become the soldier he was born to be.