In case a container is stopped, PID1 inside the container receives a SIGTERM signal, which initiates a graceful shutdown (if the process handles it). If the container did not terminate gracefully within 10
seconds, the process receives a SIGKILL and will be terminated.
Some processes require a different termination signal than SIGTERM. You should find it mentioned in the documentation of the application/service if it requires a different termination signal.
Afaik, the docker stop -t and docker run --stop-timeout only make sense if your container process already receives the correct signal, but requires more than 10 seconds to gracefully terminate the process.
If your container stops after 2-3 seconds, it means it terminated gracefully, and was not killed by a SIGKILL.
It is perfectly possible to create an image that creates containers where the main process is not started as PID1. If such an image does not use a process manager like tini, supervisord, or s6 overlay, then the SIGTERM will never reach the process, and the container will always be killed with SIGKILL.