They automatically fetch dependencies of dependencies.
Build tools like Maven and Gradle automatically resolve transitive dependencies, which are dependencies required by your project's direct dependencies. This automatic resolution saves time but can lead to 'dependency hell' if not managed carefully. For instance, if your e-commerce project uses a library that depends on another library, Maven will automatically include both.
Additional Notes
How do build tools handle transitive dependencies?