The septic tank performs two functions. First, it act as holding tank and allows the solid to settle-out. The heavier solid sink to the bottom forming the sludge layer, lighter solids, fats, grease etc. Rise to the surface and form the scum layer.
The relatively clear layer in the middle is called IFFLUENT.
Second, naturally occurring anaerobic bacteria begin breaking down the solids in size and destroying the pathogens.