I see this coming up on HN from time to time: happy current or recent CS grad student implicitly generalizing their experience to academia at large. The thing to keep in mind is that CS is a rare exception: it's relatively well funded and there is real demand for it from outside academia (the two things are not unrelated, of course). ML in particular is often said to have a "brain drain" problem. So obviously you can't treat people like serfs; if you try to, they'll just leave for a better private sector job.
Most academic fields are nothing like that. As a rule of thumb, cultism ~ 1 / (external demand).
Geologist here! It's not just CS, definitely true for us too. I can't speak for all fields, but I do know that the unemployment rate for science PhDs is virtually nil, and the industry demand is absolutely not restricted to software.
For us in the Earth sciences: mining, oil/gas, environmental remediation/consulting, and the national labs are all big employers for us.
Most academic fields are nothing like that. As a rule of thumb, cultism ~ 1 / (external demand).