The Formic Wars were a series of conflicts between the human race and the Formics over the course of 100 years. The wars began when the hive-minded Formics sent a colonization fleet to Earth, not knowing that sentient life already existed on the planet. Not recognizing the humans as sentient beings, they attempted to terraform the world to their own needs. The humans defended themselves and managed to destroy the scout ship that was sent ahead of the main fleet. However, the rest of the fleet eventually made it to the solar system, giving the humans another fight for their lives and their planet. Mazer Rackham destroyed the mothership housing the Hive Queen, ending the Second Invasion.
To prevent Earth from ever being attacked again, the humans sent an invasion fleet to the Formic Homeworld and other Formic colonies to destroy their alien adversaries. The invasion fleet was commanded by Ender Wiggin. Wiggin ended the Formic Wars when he used the Molecular Disruption Device on the Formic's homeworld, almost destroying the species in its entirety.
The First Invasion (100 BX) began when the Formic colonization fleet launched a scout ship into the Solar System and began disrupting human communications due to their periodical gamma plasma exhaust bursts. These bursts later destroyed the mining ship El Cavador, Weigh Station 4, most of the ships and structures in The Belt, and the asteroid city of Kleopatra.
As the Formic ship dropped into orbit around Earth, the humans assumed the aliens had peaceful intent and sent a United Nations ship to greet the Formics. The Formics launched a gamma plasma burst at the ship, subsequently destroying it and several other cam ships. Moments later, three massive spherical landers, each a kilometer across, separated from the Formic scout ship and streaked toward South China. Captain Mazer Rackham and his crew, deployed in China to train Chinese pilots to fly the experimental HERC aircraft, witnessed the impact of the landers and provided medical aid to injured villagers in the area. While doing so, the lander opened up to expel thousands of Formic fighters and troop-carrying aircraft. The Chinese military managed to shoot down a few aircraft, while taking massive casualties in return. Mazer discovered that each troop carrier contained dozens of Formic soldiers. Each of these soldiers had a container containing a yellow chemical agent and a misting device. When sprayed, this chemical quickly killed surrounding plant life, essentially a defoliating agent used by the Formics to defoliate the land of Southern China.
The Chinese then launched a failed offensive against the Formics inside their borders. Meanwhile, the United States launched a failed space attack against the Formic scout ship by scrounging together any ships that were capable of battle in their fleet. 
Mazer and the Mobile Operations Police used Chinese drill sledges to dig under a Formic lander and plant a nuke inside, subsequently destroying it. Meanwhile, Victor Delgado had infiltrated the Formic scout ship and learned how to neutralize it. While Victor was inside the ship, Ukko Jukes launched an offensive using glasers and vanguards, which were mostly destroyed by the Formic gun turrets. The attack, however, did manage to disable some of the guns.
A plan was put together, and Victor, Mazer, and the MOPs permeated the scout ship again and turned the gamma plasma nozzles around, giving them a way to kill every Formic inside. As they attempted to leave, they met Formic resistance. This alerted the Formics on Earth's surface to their presence, and every troop carrier returned to the landers. The landers launched back into space, while Imala Bootstamp piloted her fighter towards the Formic scout ship, attempting to trigger the motion activation of the gamma plasma nozzles. They fired, but they were turned around to face the inside of the ship. The gamma plasma quickly killed all the Formics inside, but there was nobody to shut it off in order for the humans to enter the ship again. Captain Witt O'Toole sacrificed himself by entering the ship and turning off the gamma plasma. Mazer and the MOPs re-entered the ship and used the various devices on board to destroy the incoming Formic landers.
Out beyond the Kuiper Belt, the rest of the Formic colonization fleet reorganized itself, preparing for battle against the hostile lifeforms on the planet ahead.
The Second Invasion (95 BX) began when the entirety of the Formic colonization fleet entered the interior of the Solar System and engaged in warfare with the humans. In a battle around the rings of Saturn, Mazer Rackham noticed a weak point in the seemingly random formation of the Formic ships. He fired one of the two missiles his ship had at a certain Formic spacecraft, destroying it and killing a Hive Queen. As it was destroyed, the other Formic fighter ships stopped functioning as all their pilots became brain-dead, for they no longer had a Hive Queen to control them.
Aftermath and Preparation for Invasion
After the defeat of the Formics around Saturn, the humans soon realized that there were no more fleets near Earth. However, the fear that the aliens would return and the desire for revenge for the millions of dead motivated humanity to use the near-lightspeed technology of the Formics to take the war to them. The International Fleet immediately began constructing new ships equipped with the most current technology and sent them as they were completed to the Formics' own planets, eventually centering in on their homeworld. These warships were constructed over decades, with the ships sent later having faster lightspeed drives and better weapon tech. Along with this invading fleet, the newly designed Molecular Disruption Device was sent as a trump card to combat the might of the Formics.
Unbeknownst to the humans, however, as soon as the Hive Queen was killed the Formics realized that they had attacked a sentient species, and decided not to send another fleet to Earth.
The International Fleet also sent Mazer Rackham into relativistic flight so he would still be alive when the ships reached their destination and to teach the next great strategist who would destroy the Formics.
However, the International Fleet needed to convince the public that they were under imminent threat of another invasion from the Formics in order to maintain the Battle School system. Thus, they lied to the world and stated that the fleets being prepared were being stationed around the comet shield to defend against the incoming Formic fleet.
While waiting for the invasion fleet to arrive, the Fleet created special leadership training programs, designed to take advantage of the creative abilities of children, in an attempt to find an intellect capable of commanding such a force. These were Battle School, the Pre-Command Schools, and Command School. This system was demanded by a mid-flight Mazer Rackham, who stated that if the Fleet did not allow a young Hyrum Graff to organize a way to find a new commander for the coming invasion he would never return to Eros to train him.
The Third Invasion (0 BX), later known as the War of Xenocide or the Formic Xenocide, was the third and final major conflict of the Formic Wars. Instead of the Formics attacking Earth, as in the first two invasions, the Third Invasion saw the International Fleet attacking the Formic homeworlds.
After some 60 years of searching for the ideal candidate through the Battle School system, the International Fleet had discovered and cultivated Ender Wiggin to lead their attack. Wiggin trained at Command School for around a year under the tutelage of Mazer Rackham, who had just returned from his relativistic voyage. Ender was later joined by a group of other promising Battle School students to assist him in his commanding of the fleet. This group later became known as Ender's Jeesh. However, Ender and his Jeesh were led to believe that their "training" was merely simulations of real battles against the Formics by the International Fleet. In actuality, these simulations were the real battles, with Ender and his toon leaders' commands being transmitted by Ansible over the lightyears to reach the fleets out around the Formic homeworlds.
The Third Invasion took place over the course of weeks. The fleet was staggered out between the different Formic planets, and with each victory they drew closer to the final target, the Formic Homeworld. The massive fleets were not the only theater of war, however. Ground troops were deployed to the surface of Formic planets, fighting in close quarters with Formic workers. However, as the International Fleet began to notice, all the Hive Queens had been withdrawn from their respective planets to the Formic Homeworld. While this made each individual planet a harder conquest, it made the final victory far easier.
There was only one significant loss for the human fleets, when Petra Arkanian fell asleep during the battle due to the high amount of stress the Jeesh was subjected to, causing the section of the fleet she commanded to lose direction and be annihilated by the Formics.
Wiggin was able to match the Formic's considerable strategic and tactical abilities and with help from his lieutenants was able to deploy strategies that the hive-minded Formics could not possibly adapt to. Ender and his Jeesh won battle after battle, and eventually, the human invasion fleet had conquered every Formic planet save for the homeworld. The IF fleets positioned themselves around the Formic Homeworld and engaged, but it was soon obvious that the humans would lose everything if they did not make a decisive move. Ender saw an opportunity and decided to use the Molecular Disruption Device against the planet itself, destroying it and all the Hive Queens that were currently living on the planet. Due to the Formic hivemind, this massive blow effectively ended the species, as individual Formic workers could not think or act on their own without a Hive Queen to direct them, and thus they began to die. With this decisive victory, the humans had won the Formic Wars by committing Xenocide, the utter destruction of the Formic species.
Immediately following the end of the Third Invasion, the League War took place, lasting 5 days and ending with the signing of the Locke Proposal. With no more alien threats to humanity, the International Fleet began to demilitarize and was banned from operating on Earth except in the event of another alien invasion. The Ministry of Colonization was formed to handle the Dispersal Project, the colonization of the now empty Formic worlds. The colony ships were equipped with weapons and shields, in case they encountered any surviving Formics or another alien race.
As the years went on, people began to see the Third Invasion as a tragedy, where a beautiful sentient alien race was destroyed forever. With this, people began to see Ender Wiggin as a monster, the heinous Xenocide.