Unless the software itself has the ability to "call home" to check for updates, like some browsers and things like Syncthing seems to be able to do, there is usually no mechanism that will be able to automatically alert the user/admin that there is a newer version of the software available.
Packages that you install with your package manager are made by humans, users who are likely to have an interest in keeping them up to date and functional on the operating systems that they care about.
Someone who packages e.g. Ansible, or GNU coreutils, or the Yash shell, or CMake or any other of the thousands of software projects out there for a particular Unix system will most likely (but not necessarily) be subscribed to the relevant mailing lists for those projects and/or have special tools for regularly watching source code repositories or source distribution files. When they are made aware of a new release, they will download, compile, test, patch (etc.) and package the software in the relevant ways depending on the packaging procedures on their Unix. This may involve communication both upstream (to the developer of the software) and downstream (to users of the software) about incompatibilities or other issues appearing in the building/packaging process.
Then they will, depending on what Unix they work with and how third-party package distribution works, register, upload or commit the package somehow so that users like me and you can use our package managers to update our systems.
I care, for example, for having GNU Stow available for OpenBSD (I'm the "port maintainer" for this software). I check from time to time what the current status of Stow is on the GNU web site (it isn't updated very often), and when I spot a new version I install it and make sure that it works, and update the OpenBSD port on my private machine. I then email the OpenBSD ports list with a patch for the port (ports are distributed as a set of Makefiles on OpenBSD). Someone with commit rights will then make sure that my patch applies cleanly and that the port looks correct before they commit it to the OpenBSD ports CVS tree.
The next time a user updates the CVS tree and rebuilds the port, or downloads the binary port which eventually will apear, their installation of GNU Stow is updated. But GNU Stow is not in itself aware of whether a new version of itself is available. It's simply not something GNU Stow is supposed to be doing. It's a tool that one uses to install third-party software in self-contained directory hierarchies, and it would be seriously odd if it tried to "call home" every time it was used (as odd as if
ls suddenly required network access to run).
To have software update by themselves could in many cases be undesirable as many components of a system needs to be tested together. The needed bits of infrastructure would also seriously bloat smaller packages, and it would be impossible for individuals that lack the knowhow or resources to run some kind of high-availability update server to develop software that keeps itself up to date automagically.