What exactly the permit for? Septic system

In due diligence for septic system, lot of you mentioned getting a permit.

My question is what exactly the permit for ?
A permit to install septic tank and drain field from county? Or
A ground water discharge permit from DEQ