I do not claim to be an expert, but I have done some research and I think I have this mostly figured out. Correct me if any of this is incorrect, as I have not read any of the books. From what I’ve heard, some books contradict others, and some books even contradict game lore. If there are any discrepancies, please point them out.
The initial infestation was caused by opening a Precursor capsule. The Precursors were a race from another galaxy that predated the Forerunners, and had technology that could traverse galaxies in seconds. They were considered the gods of the milky way galaxy and created the Forerunners, the Sangheli, the Humans, pretty much all sentient races. They were capable of creating life and controlling evolution. Their goal was create a galaxy with intelligent life that would thrive and be able to inherit the Mantle of Responsibility from them. For a long time, the Forerunners seemed like they would inherit it, and for a while they did (I think).
Then the precursors sent the Flood into the galaxy, to test the mettle of the races they had created to see if any of them were deserving of the Mantle. It started as a capsule of dust, which started infecting human-controlled space, and the first galactic infestation had started. The ancient humans were fighting it and glassing any world that had been infected, this included both human and forerunner worlds alike. The Forerunners took this as an act of war, and retaliated against the humans until the humans were eventually defeated and had their genetic code reset. The Forerunner realized only too late that the Humans were acting only as caretakers, as if they held the Mantle. I’m not entirely sure how the Didact, or the Forerunners in general, felt after learning this information. I’m not positive if it was pride or fear that motivated their actions, but they decided to fight the flood with all their might. They were losing. Badly. The Halo rings were then constructed by the Forerunners for the purpose of annihilating all life in the galaxy, except for what was sealed in capsules for reseeding, those sealed in shield worlds like Requiem, and those specimens sealed inside the Halo rings themselves for further study. After exhausting all other strategic options (skipping over details of the Prometheans here) they fired the Halo rings, eradicating everything so that the galaxy could, basically, reset itself using the seeds the Forerunners planted.
Cue Master Chief’s era. Each Halo ring had flood specimens that the Forerunner had contained for research, for the purpose of finding a cure as yet another contingency plan in case there were more flood lurking outside of the galaxy (which would be outside the range of the Halo rings). To my knowledge, no cure was ever found. The Covenant were responsible for releasing the second infestation on installation 04, which was later destroyed by Master Chief, which was done in part to end the infestation as well as make sure the ring wasn’t fired. Then the third infestation happened on installation 05 when, once again, the Covenant (or a “heretical” offbranch, I can’t seem to remember) released the flood specimens on that ring. This infestation was worse than the second, spreading to the covenant city of High Charity and consuming it entirely. It also threatened Earth and resulted in a fraction of it being glassed. This infestation ended when Master Chief (Spartan John 117) and the Arbiter (Thel Vadam) fired the new installation 04 that was currently under construction on the Ark. This single Halo ring destroyed all nearby life, ending the infestation. To my knowledge, no human or Covenant occupied planets were within range of this particular ring, and Arbiter and Chief each made it out alive.
So the flood has threatened to consume the galaxy at least three times. The second outbreak was isolated to a single Halo ring, the third threatened Earth and consumed a Covenant city as well as spread across installation 05 and the Ark, but none were as terrible as the first infestation. The first infestation grew so large that there were numerous Graveminds coordinating a central Flood intelligence in order to lay siege to and infect the entire galaxy. At the height of the conflict before the firing of the Halo rings, I expect that the Flood had consumed at least half of the galaxy.
Correct me if any of this is wrong.