A septic tank is a storage tank which holds and retains all the solid waste & passes on the untreated waste water to a soak away/drainage field.
You are not permitted to drain directly from a septic tank into a watercourse/ditch. You would need to install a sewage treatment plant
A septic tank works by allowing the solids to settle to the bottom and the effluent to flow out. The outflow from the septic tank usually requires further treatment and this is achieved by soaking it away into the ground, where bacteria in the soil completes the sewage treatment process.
A septic tank will have some kind of baffle or dip pipes to separate the sludge build up from the effluent leaving the septic tank through the outlet.