I think GP was asking what happens when you remove a package that has thelib.so as a dependency. Is thelib.so removed? Does the previous existing thelib.so used as a replacement?
With any normal package manager, no. You don't remove a package that has any remaining 'reverse dependencies' (a.k.a 'dependents'). Removing only one of many dependent packages just has no effect on the dependency.
But if BOTH packA & packB come with the same libs, one of them HAS TO get symlinked in the system index. And they do not depend on one another, as each has to bring the same lib to the system, so logically, they can both be removed without breaking a dependency.
But since there can be only ne symlink to the library (because the lib is searched by name in the index) the question remains: How is the package manager handling this for Gobolinux?
and then you'd have to use SymlinkProgram to enable another provider of the shared libraries.
In a way this is inside-out from what Nix and Guix do, where their equivalent of the System Index (the Nix/Guix store) is the build target, and everything all symlinks point to that. That makes this kind of thing a little easier to deal with, at some other costs.
Why would two different packages have the same library in them? Surely for every library there's a single package for that library, and if multiple applications depend on that library then their packages would depend on that package.