Sand filter
A layer of sand or gravel is used when sewage goes through  sewage treatment. Before sewage comes to the bacteria bed, it should already have gone thru part of the sewage treatment. At the bacteria bed, sewage gets exposed to (or has contact with) air, while microorganisms make some change to that sewage. The oxygen in the water kills the microbes, which are anaerobic.