I have a lot of (maybe too much) experience in this area, not only because I have a PhD but the other details I’d rather not go into it too much. However, most of the following comes with respect to Australia, it may or may not be relevant to other countries.
My opinion echoes a lot of what is said here already.
1. If you want to be in academia, you need it as a “tick the box” measure; most universities I have been involved with simply won’t hire you if you don’t have one. There isn’t really much choice here except in a few areas like architecture and design. I don’t think this is the case for pretty much any other workplace.
2. If you do a PhD as a way to earn more money, you are probably going to be disappointed. In Australia the most competitive scholarships still earn less than minimum wage. Like you could be kicking butt on cancer research or something that is really obviously good for society, and you’ll be earning less than if you worked at McDonalds. At least in Australia, graduate degrees don’t appear to be valued that much by employers except in very specific circumstances (I don’t agree with this, but it is what it is). It can be an impediment to getting a job because HR will say you are “overqualified”, and in Australia we are very strongly influenced by “tall poppy syndrome” - having a PhD makes you a target for this. I think Europe is much better in this regard.
3. A person doing a PhD between the age of roughly 35-50 years old seems to be getting rarer (anecdotally). Given the price of houses/sizes of mortgages today as well as the age people normally have kids, that kind of makes sense. Most people seem to do it immediately, or closer to retirement for financial reasons (I was in the former).
4. A good supervisor/colleagues is extremely important. I’m not necessarily talking about research pedigree, I mean more in terms of interpersonal skills, how friendly/helpful people are, etc. The last thing you want to be is a PhD student for a “superstar” researcher with a well recognised name, but who has 50 other students and 10 postdocs as well as an executive position elsewhere, etc. There are also supervisors who just want PhD students so that they can use them to teach their classes.
What I usually tell people is (at least for engineering and most science): the only reason you should do a PhD is because you want to go deep, deep down a rabbit hole. Because my own experience is that you would need to do so, right to the point where the number of people in the world who can even understand what you are working on begins to move towards the single digits. That’s not to say that it makes you a “genius” because you know more than everyone else (you definitely don’t/won’t), but rather you would like to really persist in something intricate that you want to learn about. This could be GaN FETs as much as it is the breeding patterns of hummingbirds in a specific town in the US, or optimising the way you make dyes out of crushed beetles.
The reason it can be tricky to get a job with this sort of thing is that it can be tricky to convince an employer that this depth is useful. For example, if you did research into MEMS devices, but then went to work for a power distribution company, your knowledge of MEMS is probably not going to be all that useful even though it may be considered Electrical Engineering and your employer (perhaps rightfully) would not want to pay you extra for that knowledge. Certainly you could argue that your time management, organisational skills etc are demonstrated by having a PhD, but you could have done a PhD in lots of other things and still be able to argue that.
PS: “going down a rabbit hole” is an idiom in English which basically means to strongly persist in investigation, regardless of how weird/complicated/difficult it gets. It is a reference to the original story of “Alice in Wonderland”.