An important point missing from the other answers:
Using a package manager means having a configuration that indicates which library versions you are using and makes sure that config information is actually correct.
Knowing which libraries you use, and which version, is very important if you:
- need to update a library due to a critical bug / security hole;
- or just need to check whether an announced security hole affects you.
In addition, when you actually do update, the package manager (usually) makes sure any transitive dependencies are updated as required.
Whereas with a
lib folder, you just have a bunch of (possibly binary, and possibly modified) files, and you'll have to guess where they came from and what version they are (or trust some README, which may or may not be correct).
To address your other points:
No need of external tool to manage packages.
True, but a) as a software developer you need to install loads of tools anyway, so one more does not usually matter, and b) usually there are only one or a few package managers in any given field (Maven/Gradle for Java, npm for JS/TypeScript, etc), so it's not like you need to install dozens of them.
No internet connection required to build.
All packages managers I know work off-line, once they have downloaded the required dependencies (which can happen right after downloading the project itself).
Faster build (no package checking).
Probably true, but it seems unlikely the offline package checking will take a significant amount of time (it's just comparing some version numbers). An online check may take a while, but that can be turned off if desired (if it is even on by default - Maven for example never checks for updates for release versions).
Simpler environments (less knowledge required).
True, but as explained above, a
lib folder also requires knowledge. Also, as explained above, you'll probably only work with a handful differen package managers, which you'll know already.