The Precursors seeded life in the galaxy. With their supremely high-tech machinery, they bordered on being gods: creating life, creating worlds, traveling even between galaxies within seconds.
As “gods”, their life was devoted to ‘the Mantle of Responsibility’ (later followed by the Forerunners).
"Guardianship for all living things lies with those whose evolution is most complete. The Mantle of Responsibility shelters all.”
Millions of years before the Halo event, they reigned across the galaxy. But after getting into a quarrel with the Forerunners (presumably about them not being worthy of reclaiming the Mantle) they got obliterated in open combat, massacred. Most of them died but few managed to escape to somewhere “beyond your reach” (presumably out of the galaxy). The Forerunners took control of the galaxy, then, and with it they claimed responsibility for the Mantle.
Hundreds of thousands of years past, and the Forerunners were still in control, when Ancient Humanity found a derelict ship drifting through space. Inside, there were thousands of canisters filled with a powdery substance. One thing led to another and humanity and their friends the San Shyum- the Ancient Prophets- ended up using that substance as pet steroids (not really but there is no good way to explain this).
A few years later, when upgrading your pet became part of the norm, these pets started growing extra eyes and antennae and became exceedingly violent. They began tearing the human civilization from within, killing millions and reanimating their corpses to create horrific deformities. They are known as the Flood.
In an effort to survive the Flood, humanity ended up invading Forerunner territory- which was taken by the Forerunners as an act of war. Soon, humanity was fighting on two fronts. The Flood were at their back while the Forerunners were at their front. They had to take extreme measures to survive, and they did. They injected two thirds of their society with some sort of cure and sacrificed them to the Flood, which this cure was attacking. They ended up driving the Flood away, out of the galaxy, but they were too weakened to deal with the Forerunners.
The humans were held up on Charum Hakkor when they were defeated, and there they held the Primordial- an ancient entity that claimed to be the last Precursor but was really just a next step in a gravemind’s evolution- imprisoned in a time lock. As a punishment for their crimes, humanity was devolved and placed on their supposed home planet (Earth) to continue their lives.
Thousands of years later, the Flood returned with a whole invasion force, wiping out Forerunner colonies one by one. The Forerunners, remembering that humanity made a cute for the Flood, began an intense operation by implanting ‘composed’ personalities of ancient human generals into the devolved humans, to try and reveal the cure and a way to fight the Flood.
Meanwhile, Forerunner AI Medicant Bias was assigned to investigate the Flood and their intensions, after finding the Primordial while conducting an experimental Halo firing. MB and the Primordial talked for forty years straight and in the end, MB realized that the Primordial was right- the Flood was necessary. MB turned on his creators, fighting for the Flood and taking a Halo with him.
Near the end of the conflict, the Didact managed to find the Primordial on MB’s captured Halo. There the Primordial revealed that the Flood are the answer to life’s great problem. Every sentient life form fights wars, it’s at their nature to do so, and yet it goes against the Precursors Mantle to fight. After learning that the tough way with the Forerunners, the Precursors decided an answer must be found. As long as there are multiple factions there will always be war, they realized. So their answer was unity.
They would unite all sentient life, capable of destroying and warring, under one faction, one essence, one hive mind. The gravemind. This creature would enviro irate the personalities of all the creatures it consumes. It will spread like an infection, devouring all that come in its path to unity. There will be years of war and death between sentient life and the Flood, but the end would justify the means, for there would be no more war. Only unity.
Some people theorize that after creating the Flood, the Precursors gave themselves to it. Sacrificing their bodies for the mantle and thus creating the Primodial, although those are just theories.
Before the Didact kills him, the Primordial reveals that there was never a cure to the Flood. The Flood simply chose to recede after testing humanity, finding them worthy of reclaiming the Mantle. There is no cure for the Flood, and they were coming in hard.
That was when the Forerunners resentfully activated the Halo Array, cleansing the galaxy from life and thus starving the Flood until it disappeared. Although, some Forerunner facilities still keep Flood samples, in hope to find the cure that the Primordial states had never existed.