An order saves you a judgment
The student next door is banging on the wall, yet the researcher says to go on. If you do as you're told, you don't have to judge for yourself whether to stop. Obedience has two sources: an expert makes you believe he knows something you don't, and a superior makes you feel that orders are there to be carried out. In labs and hospitals, the person giving orders is often both. Then, to object, you also have to bear the pressure of interrupting what's going on and questioning the other person's standing.
Hand over the responsibility, and self-restraint loosens
Once people see themselves as just carrying out orders, the question in their mind changes from "is this right?" to "did I do what I was told?" Milgram later called this frame of mind the "agentic state": feeling that you are only acting for someone else, and the consequences are for the person giving the orders to answer for.
The farther the order and the closer the pain, the fewer go all the way
Milgram himself tried different setups. In the original setup, over 60% went all the way. When the researcher left the room and gave orders by phone, it fell to about 20%. With the volunteer and the student in the same room, it fell to 40%. When the volunteer had to press the student's hand onto a shock plate himself, only 30% were left. The farther away the person giving orders and the closer the student's pain, the harder it was for the order to override judgment.
When the authority's expertise fits the question, the advice is backed by evidence and mistakes can be corrected, listening to authority is both easier and more accurate; at an emergency scene, someone giving unified orders is all the more needed. The trouble is using a title to overrule other people's views. The opposite, deciding you know better than every expert, is just as much trouble.