How do emergency stop buttons work?
The answer is yes!  All of the above!

The bottom line is that pressing the button should stop things in a safe way.  Sometimes this means that they just cut power.  Other times, when just cutting power is not the safe thing to do, they hook up to some type of controller that brings things to a halt in a safe way.  What type of controller?  Well, that depends on the machine and what is required (and is beyond the scope of this question).

Most exercise treadmills, for example, have an emergency stop.  Sometimes it is just a large red button.  Sometimes it is a clip+string that attaches to your clothes and when it is pulled (because you lost your balance) it activates.  When it activates, it tells the MCU inside the treadmill to stop the belt.  It doesn't cut power, it just stops the belt.  

But I have also seen whole computer rooms that are attached to a single red button.  Pressing the button will cut power to absolutely everything in the room, including all of the servers and the air conditioning.

Amusing Story:  I once worked in a computer department with just such a button.  The button was mounted on the wall in such a way that if the door to the room was opened too far it would hit the button and shut down power to everything.  After this happened one time too many we put a wire cage around it.  Fingers could still get in to press the button, but the door wouldn't.  Some emergency stop "buttons" are the kind you PULL, not push, to activate for just such a reason.