The answer to this question can be found in chapter 15, which is the book's final chapter. Ender was originally brought to Eros because that is where Command School is located. Eros was originally colonized by the Buggers, but the humans now inhabit the asteroid. It is on Eros that Ender meets Mazer Rackham, receives final training, unknowingly battles against the Buggers, and leads humanity to defeat the Buggers.
Ender is heralded as a hero by everyone on Eros and on Earth. Unfortunately, the feelings of peace and joy do not last long, as Earth is plunged into a massive human-versus-human war as various countries try to gain power over other countries. Humanity is no longer unified in a fight against a common enemy, so humanity begins fighting against itself. Peter and Valentine work together to make sure that Ender is prevented from returning to Earth. People would either try to kill Ender or use him as a puppet for their governments.
More than a year after Ender's victory over the Buggers, Valentine arrives on Eros. She tells Ender that she is part of Earth's efforts to colonize new worlds in the Buggers' former galaxy. Valentine explains that her trip will take fifty years in Earth time, but it will only be two years of her life, because they will be travelling at relativistic speeds. Valentine also asks Ender if he would be willing to leave Eros and come with her. Ender agrees.
"All right," said Ender. "I'll go. Maybe even as governor, as long as you and Mazer are there to help me. My abilities are a little underused at present."