How is this Docker service called?

I am studying the Crunchy Postgres implementation to understand how it works.

The Dockerfile at this link runs this start.sh script as a service which remains running until the service receives a kill signal.

Can someone please explain each of the circumstances in which the start.sh script is called?

Obviously, the start.sh script is run when the container is initialized. Under this scenario, the PG_MODE environment variable is set to equal set because that is the default setting in the kubernetes statefulset code at this link.

However, the start.sh code contains a block of conditional logic for PG_MODE=replica located above the first PG_MODE=set conditional block. This indicates that start.sh can be called at times during which the PG_MODE variable has already been changed to differ from the set value defined in the Kubernetes code.

So what are the situations under which the start.sh script/service can be called? And where in the open source github code can I find the code that would trigger start.sh at a time other than startup?