It is entirely up to the vendor of each application to provide an uninstaller. There is no universal standard place where the list of files/reg settings that need to be removed are stored. This is why so many programs leave a ton of their garbage all over the hard drive. Most programs simply do not clean up after themselves very well.
Most software vendors package their software in a 3rd party installer, the most common of which are InstallShield (Flexera Software) or Microsoft Windows Installer (.msi). These installer products allow software vendors to define tables that contain all the files and reg settings in the payload and where they go. They also provide a scripting language that vendors can use to make decisions during the install process.
These products make deploying applications easy for vendors without having to write their own installation routines, but the point is that it's still up to each vendor to actually use those features. Both Microsoft and InstallShield automatically generate a basic uninstall routine for you when you build a project, but it just removes the files and reg settings listed in the tables -- provided they haven't changed. They won't remove anything added after or any settings in the user directory, and they won't apply any intelligence to the uninstall by default. If anything is ambiguous, it gets left alone.
It is for this reason that uninstallers are so sloppy and why it's practically impossible to cleanly remove an application when that vendor was just too lazy to think about such things (or worse in the case of crapware, doesn't want you uninstalling their app).