So.... yarn can optionally flatten files, and this is sometimes what you want, particularly if you are targeting the browser. The default npm cli cannot do that, however, because it is designed to work with node module loader and solve node's specific problems, which are quite different. The intent of npm is to avoid dependency hell by dodging it, through the specifics of that loader-- you can have more than one copy of lodash! Your code gets the one that you specifically asked for!
This is, you'll note, a tradeoff that is absolutely great for server-side javascript, which is where it was designed to be great. It's the wrong tradeoff for browser-side javascript, where having N copies of lodash is far too costly. So coping with dependency hell and selecting the one winning version of lodash is a different tradeoff, and one that is the correct one to make in that circumstance.
In other words, I'm a-okay with a world where there are lots of tools that lay out packages on disk in lots of different ways, because the problems they're solving are different.