Backed into a corner with the Flood nipping at their heels, the Forerunners decided to try something crazy. The Flood would die if they couldn’t eat, and since they ate biological matter, all the Forerunners needed to do was to get rid of all of that. Simple enough, right? First, a Forerunner known as “The Librarian” went throughout the galaxy collecting samples of all life, indexing it into “The Ark.” Then, the Forerunners killed everything.
In order to starve the Flood, the Forerunners built the Halo Rings. When they were activated, all life was wiped out, and then slowly replenished thanks to the Ark. That’s why there are still humans and other aliens. The only Flood that survived were test subjects, locked away so they would never escape. They, of course, did.