TLDR: A PhD is a significant commitment that can offer unique opportunities for intellectual growth, research training, and career development - but it's not for everyone and shouldn't be. Here's a couple of models of when a PhD can be valuable.
A PhD is a weird thing. For many people, it's a very, very long-term decision that they make at age 21. At the end of it, you're a world-expert on a very specific sub-area. The person you are at the end of it is so distinct from who you are going in that it's almost impossible to envision. It's also hard to get a sense of the pros and cons of a PhD! So I wrote this up to help people think about some buckets where I think it makes sense to get a PhD. I've also sort of ranked them by how good of a reason I think they are.
A PhD offers a rare opportunity to go wildly deep on a question that fascinates you. If you just genuinely have a need to learn something about the universe that people don't know yet, I can't imagine a better reason to do a PhD. The intensity of this need can vary, sometimes people can't imagine doing anything else, sometimes it just seems more fun than available alternatives. But if you are thinking about a PhD because you're obsessed/very into a particular field or a particular question, it's likely a reasonable path.
An underrated reason to do a PhD is that you'd like to investigate a topic or question that simply cannot be answered in industry. This can occur for many reasons:
This one particularly reasonates for me because it's close to one of my reasons for being in academia; I believe that there are ways to build systems using reinforcement learning that other people don't believe in yet. If I was to spin up a company around it, I'd have to show signal or progress towards a product in a year or two but I think it's just going to take so much longer than that. As another example, and one that occurred in my PhD, if you're interested in designing a system of cooperative autonomous vehicles that collectively improve traffic, it's near impossible to get a job where you'd build such a system. It's at least 10+ years away from deployment, if not more, and there's almost no reason for a company to fund it right now.
A PhD is not 100% skill development but it's also one of the only ways, short of being independently wealthy, to be financially stable while having the free time to take the classes you want, read textbooks, attend reading groups, and learn to code. Personally, as someone who entered graduate school basically not knowing how to seriously program, I benefited immensely from being in this bucket. I don't think it's wrong to graduate undergrad, realize there's some skills you need a few years to develop, and use graduate school as a way to develop them. It's not perfectly aligned because you're going to spend a ton of time on your research but it really is a viable path to developing expert skills in some area.
Look, the immigration system in almost every country is weird. A side benefit of getting a PhD is it's quite often a path to a green card. Sometimes you're just in this bucket!
A PhD is emotionally and intellectually challenging. You need to look at all the knowledge experts have gathered before, identify a gap that is interesting, and then find a way to fill that gap! By the time you're at that frontier, you can certainly ask colleagues for help, but some piece of it is inevitably something you need to do on your own. You need to find ways to motivate yourself, to convince yourself of the value of your own results, to figure out how to manage an entire research program. You'll get mentorship on this but in the end it really falls on you. The type of person who can do this is often quite different than the person coming into the program. In other settings, it can be hard to get the time needed to build this type of self-reliance and self-confidence. When you hire a good PhD, you can just throw them on a project and assume they'll figure it out. That's a rare skill!