Do most professors value their PhD students, or do they see them as easily replaceable by fresh, new blood? If a PhD student stops working, will the professor try to fix things, or replace him like a cog in his machine?
Most PhD advisors invest a great deal of time, money, and effort in their PhD students. This is a sunk cost.
If the advisor acts as a selfish rational decision maker, he/she would evaluate the prospective (future) costs of continuing to work with the student, the likelihood of the student becoming productive again given some level of intervention on the part of the advisor, and the benefit to the advisor if the student becomes productive again. Other contributing factors may include the cost to the advisor's reputation of having a failed PhD student and the impact of a failed PhD student on the advisor's promotion prospects.
Based on these parameters, a selfish rational player could evaluate whether it is in his/her own best interests to try and "fix things" or whether to cut his/her losses and "replace him like a cog in his machine."
In other words, there is no single action taken by "most" advisors here - the best response of even a purely selfish advisor depends on the parameters of the situation.
Finally, most of the PhD advisors I personally know also feel some level of affection for their students and personal interest in their future, and would not necessarily make the strictly selfish decision described above. Rather, most PhD advisors I know would make an irrational decision that would consider the students' interests in addition to his/her own selfish interests. Depending on the situation, it may or may not be in the student's interests to be "fixed."
I have seen it go in both directions, and which way it goes seems to be strongly correlated with theoretical vs. experimental science. The more that a professor's research requires lots of "lab tech" work, the more likely that a student may find themselves treated as a lab tech rather than an independent researcher in training. I think that has been significantly driven by the economics of funding, since a) many funding agencies have become progressively less willing to support lab techs, and b) a good lab tech can easily cost 2 to 4 times as much as a student, depending on field, cost of living, and how a university does its accounting.
Another place where I have heard of things going particularly badly is with foreign students (and postdocs) in the US, where an unscrupulous professor can use the delicacy of visas to exploit students.
In the end, however, the strongest determinant is the individual professor: in every field, there are both excellent people to work with and horrible people to work with.
As others have mentioned, it is not at all universal that grad students or postdocs are "helping" their faculty advisor. That is, often the relationship is more teacher-student than boss-worker, to say the least. Yes, hopefully the discussion takes place with content at a far more interesting level than absolutely routine teaching might. Yes, such discussion can be stimulating and edifying to the advisor about the advisor's own larger enterprise. The model is that, for example, the advisor has a certain research program, a grad student or postdoc expresses some interest in the content, and the advisor is happy to spend time explaining and talking about it. Grad student or postdoc does a related project, and generates a PhD thesis or paper or...
In such a context, there are at least two relevant sorts of "dysfunction", which I do put in quotes because it's only a very qualified sort. The first, and most relative, is that the student/postdoc (rationally/justifiably or not) loses interest in either their own sub/related-project or in the advisor's larger enterprise. That's fair. This is not a "problem" except in the most practical terms, about whether it is feasible for the student/postdoc to significantly change course given whatever funding-and-time constraints they have.
A very different sort of problem is student/postdoc's personal crisis/situation not generated by the work, such as (mental or physical) health difficulties, living-situation difficulties. Of course, very often such things have a huge impact on the work. Most advisors are not so callous as to be able or inclined to hold the student/postdoc culpable for the vagaries of fortune... So, at least up to a substantial point, I think most advisors try to be sympathetic, indulgent, hoping that things heal up well enough to allow return to a more "normal" role.
There is also a caricatured situation that according to substantial gossip seems to be perceived as relevant by, for example, grad students: the alleged scenario in which grad students are expected/required to be near-geniuses, are gradually discovered not to be, and thus are branded as failures, tossed aside in favor of other genius-contenders. I think this fantasy-scenario is not relevant to actual events, but can play a negative role in the mental-health aspects of students/postdocs... The point is not that the scenario takes place, but that people worry about it: hopefully the advisor offers appropriate reassurances of the irrelevance of that little myth.