Duplicate code across the ecosystem is fine. Not every function must be unique for an entire programming language.
I don't need left-pad.
But maybe I need react-starter-kit.
Now, imagine that react-starter-kit has a dependency to markdown-js-blobber, which has a dependency to make-text-nice, which has a dependency to left-pad.
In this scenario I am now "pulling in a package to pad a string". If I am "smart enough to use a package manager", I should be "more than capable to write..." an alternative to react-starter-kit..?
Combine this to mainstream education teaching that you should always reuse code when possible instead of "reinventing the wheel", and web shops agreeing to it because "using libraries saves time", and it's easy to understand the "popularity" of left-pad.
To a certain extent, and to the best of my knowledge, those things haven't really changed.