Installers work by 'logging' what they have done on your system. Alot of installers don't use .log files for this, but some sort of internal extension with encryption to help prevent the user tampering with it.
When a program first loads up on your PC, it is safe to assume that it WILL infact add even more registry values and files to your machine (which the installer didn't do).
When the user tries to uninstall the program, the Uninstaller will only remove what the Installer added or recreated and not the program's.
Think of a Installer as a very advanced Self Extracting archive file. If more files have been created that the Self Extractor didn't make directly, these files will probably stay on the system.