Two other answers explain what exec "$@" does. This answer on Stack Overflow explains why it’s important for Docker, and as you surmise, it does have to do with signals:
This is important in Docker for signals to be proxied correctly. For example, if Redis was started without
exec, it will not receive aSIGTERMupondocker stopand will not get a chance to shutdown cleanly. In some cases, this can lead to data loss or zombie processes.
If you do start child processes (i.e. don't use
exec), the parent process becomes responsible for handling and forwarding signals as appropriate. This is one of the reasons it's best to usesupervisordor similar when running multiple processes in a container, as it will forward signals appropriately.