I'm not saying that going to graduate school is necessarily a mistake but I think a lot of people go because they've done well in school up to that point and aren't sure what else to do with themselves.
Depending on the PhD program you can be required to take as low as 1 PhD level course per year. The "real" learning takes place by reading papers + lab work.
The transferable knowledge might not be the specific capacities developed (e.g. how to properly plan and manage a multi-step organic synthesis, how to write an SCF routine, etc) but rather to be able to sit down long enough and reason about the world to make hypotheses and test them. That in general is very useful and a skill most workers in the workforce simply lack. I do not say this to be condescending, it is simply my experience that there is a clear divide in the mental processes of people who went through at the very least a Bachelors' vs people who did not. It's not better or worse, it's different.
PS: Anecdotally, I have not completed my graduate degree for reasons of lack of funding. I really enjoyed what I did but TAing 2-3 courses per semester while working a part-time job (or two) to make sure I could get some vacation time once a year, pay the bills and go to the restaurant with my SO just wasn't worth it. As others have commented, money in academia is most definitely a winner takes all game. Experience showed me that in a cohort, it's mostly the top 5 or so students with excellent grades that will get the scholarships. Then you get maybe a dozen or two who live on ~1k a month and the rest well, fend for yourself (even if you have an advisor). I happened to be in a sub-field where professors were broke, so that was it. I eventually quit due to being absorbed in other (boring but paying) work, with now realising it was a mistake but a mistake that brought food on the table. Today I regret and want to go back, but you can't feed a family with $10k a year can you?
I don't know if that is universally true. This type of anecdata tends to be very program specific.
I worked on the computational side of things and got paid a lot to work on (what I thought was) interesting stuff.
Folks who did experimental work (especially on the bio side of things) tended to put in more hours even over the weekends because biological substrates are no respecters of leisure time. On the other hand, it's much easier to publish experimental results than to come up with a new algorithm, so many ended up with quite a few publications than I did when they graduated.
I say this as a recovering humanities academic who now works in tech; I am really grateful that my parents pushed me to have a STEM major alongside my interest in music.