So, you want docker containers ;)
Shared libraries have many advantages :
- Updates : when the library is updated (bugfix, security, ...) every app using it benefits from it, even if the app itself isn't updated
- Disk space : no need to have several copies of the same thing.
- Memory : read-only parts shared libraries are usually loaded only once in memory for all apps using it
- Performance : an effect of the two previous points, results in faster loading time, better cache efficiency, ...
The scattering of data isn't there for nothing either : an app can have several parts with different purposes. There is the executable and other static files that are used only by the app itself, shared data, system configuration, user data, possibly for several users on the same system... The "everything in a single folder" approach has its drawbacks. That's why different OSes work differently.
- Linux distributions : heavy use of shared components backed with powerful package managers. This goes well with free software, package maintainers, who have access to source codes and can modify and redistribute at will make sure everything work together.
- Windows : A huge mess of partly individual, partly shared components. Not pretty but Windows has a lot to deal with. It has to play along with both open and closed software models, it has decades of history behind it and cannot afford to throw everything away.
- Android : It is much closer to what you describe : every app is mostly self-contained and removing it removes all traces of it. It can get away with it because much less flexibility is required from mobile devices. It is also commonly backed by cloud storage, so losing your local data is typically not a big deal.
I don't know about the Apple side of things but considering they are mostly closed system, package management is probably cleaner.