apt upgrade replaces the files on disk, but a daemon that was already running keeps using the old library from memory. Nothing tells you that unless you ask.
The man page says needrestart checks which daemons need to be restarted after library upgrades. On Debian and Ubuntu you install it with apt and run it as root. To only look and not change anything, use list mode:
sudo apt install needrestart
sudo needrestart -r l
The -r option sets the restart mode. The letter l lists only, i restarts interactively and asks per service, and a restarts automatically. Other options narrow or change the check: -k checks for an obsolete kernel, -l for obsolete libraries, -v is more verbose and -b enables batch mode, which gives output meant for scripts.
What I would do on a server is run the list mode right after an upgrade and read what it names before deciding anything:
sudo apt update && sudo apt upgrade
sudo needrestart -r l
Then restart the named services one at a time with systemctl restart when it suits you.
The automatic mode restarts services, which on a server means a short outage for everything that runs there. I would not set it to a on a machine where something must stay up. A pending kernel update also still needs a reboot, and no service restart replaces that.
Further reading: needrestart(1) manual page