The Flood is a bio-machine created by the Precursors to download memory from a deceased Precusor and store it in an archive Flood aka Gravemind. The Forerunners found them but the Flood was rampant and needed new hosts so they attack the Forerunners. From here on it was the Forerunner-Flood War. When the Forerunners sacrifice themselves they chose Humans to take their place and after a millenia or few the Flood was release again, but we prevailed for a short time. After the events on The Ark the Flood attack Covenant and Human worlds alike. With the alliance of both Covenant Separatist and UNSC they prevailed again.