To add another perspective to this, there are two important factors that make people start a PhD, not least of which is a misconception about their likelihood of success.
The glut in PhD candidates is partially fueled by faculty members misrepresenting one's prospects post graduation. Doing a PhD in the hopes of securing a position in an R1 faculty position is, statistically speaking, a (very) risky prospect - lots of good people competing for very few positions.
Of course, faculty members who are already in these positions suffer from observation bias, and see their road to these positions as straightforward, whereas it is in fact far from it. I don't think that faculty members who encourage people to enter grad school are being malicious: they genuinely believe that their success can be replicated with hard work and determination; this is often not enough to succeed (there's a tremendous amount of luck, and qualities like creativity that are hard to teach). School recruitment of course has no interest in telling you otherwise - they want to keep those enrollment numbers high, thus you may get very skewed signals.
One might say that even after graduation students are still (weakly) more employable than they were before studies. This is probably true (you probably won't become homeless!), however, you are not factoring in lost wages, job experience, and losing what are probably your best years career development wise.
As an example, some people (in CS and related disciplines) start their PhD under the false impression that it will improve their chances of securing a software engineering job. As I cover in this answer, you stand to lose roughly $500k++ (probably more) by simply entering the PhD program. While you won't end up being homeless (probably) if you graduate with a CS PhD, losing out on this amount of money in sunk costs/lost wages is something that most graduate students don't even consider when entering the program (at least not the ones I had a chance to interact with).
This is not counting time spent doing a postdoc, or adjunct teaching. Both positions pay peanuts (I think in some disciplines you're better off financially by flipping burgers), and that's again time and wages lost.
To conclude, people tend to romanticize academia, and overestimate their chances of succeeding after graduation. This tends to lead to them making poor choices, and unfortunately, faculty members/recruiters often enough are not helping them understand what they're getting into.