Time Machine backup: Does it create a disk image? Or replicate data on the backup drive? When I use Time Machine to backup my MBP hard drive: Does it create a disk image? Or replication data on the backup drive?

Am asking because I wonder whether erasing the hard drive, reinstalling OS, and then restoring from a Time Machine backup ...  would help free up space (occupied by dropped databases) or get rid of conflicting bits left by package managers like NVM, NPM etc.
Time Machine does not create a disk image, and it instead copies over files to a folder on the target destination. It copies over almost all the files, except for a few system files and trash files. When backing up to remote drives like a Time Capsule, it uses Sparse bundles.

Erasing the hard drive and restoring the backup might free up some storage, but it'll be very, very little and probably not worth the effort.

Source