Specifically, this is how a typical septic system works:
All water runs out of your house from one main drainage pipe into a septic tank.
The septic tank is a buried, water-tight container usually made of concrete, fiberglass, or polyethylene. Its job is to hold the wastewater long enough to allow solids to settle down to the bottom forming sludge, while the oil and grease floats to the top as scum.
Compartments and a T-shaped outlet prevent the sludge and scum from leaving the tank and traveling into the drainfield area.
The liquid wastewater (effluent) then exits the tank into the drainfield.
The drain field is a shallow, covered, excavation made in unsaturated soil. Pretreated wastewater is discharged through piping onto porous surfaces that allow wastewater to filter though the soil. The soil accepts, treats, and disperses... wastewater as it percolates through the soil, ultimately discharging to groundwater. If the drainfield is overloaded with too much liquid, it will flood, causing sewage to flow to the ground surface or create backups in toilets and sinks.
Finally, the wastewater percolates into the soil, naturally removing harmful coliform bacteria, viruses and nutrients. Coliform bacteria is a group of bacteria predominantly inhabiting the intestines of humans or other warm-blooded animals. It is an indicator of human fecal contamination.