well, my experience with DMs is this....
They are there to lead you around or to a dive site.....
They brief you on the site....tell you what is/isn't safe there....what potential dangers are, what conditions are, etc. They give you minimums and maximums (if they feel it is warranted) for dive times and surface intervals.
they oversee the operation of the dive itself. Sometimes they dive, sometimes they don't.
As far as liability is concerned, I feel if they have done something to affect the decision of a diver (follow me over here to this depth) and something happens, they are responsible. IF they decide to drop a group in knowing that conditions are too risky, they are responsible.
Once the diver themself does something stupid...the DM is really no longer responsible b/c s/he sore of becomes a rescue diver. Thus you would want to try to resolve the problem, but sometimes, you just can't.
Yes, everyone knows that prevention is the first step.....but sometimes stuff happens and Responsible individuals have to put themselves at risk to save person X. If they decide to take that risk, it is calculated......and this not not just true of the dive industry...it is rock climbing, fire fighting, police work, rafting, etc.