Zammad by default uses a socket connection to your postgresql server.
The authentication is handled on user basis which should be perfectly fine.
Technically this doesn’t have to involve any passwords for that reason.
I think the perfect lecture for that is postgresql documentation:
https://www.postgresql.org/docs/9.1/runtime-config-connection.html
We basically allow user “zammad” to access the database “zammad”. The Zammad services are running as this exact user.
Of course, above only applies in a default installation. No more magic is done.
If you care what exactly has been run, you can view it here:
Functions is called by https://github.com/zammad/zammad/blob/develop/contrib/packager.io/postinstall.sh
on every installation and upgrade.