Short answer
Servlet containers like Tomcat use child-first loading so each deployed web app can bundle its own version of a library without the container's version winning, giving per-application isolation and hot redeploy.
Explanation
Plugin systems and OSGi do the same to support conflicting dependency versions in one JVM. The danger is class loader leaks: if a redeploy leaves a stray reference into the old loader, none of its classes can be unloaded and Metaspace grows until OOM.
Common mistakes
- Breaking delegation without a reason (plugin isolation, app servers).
- Ignoring class-loader leaks when redeploying.