"You will do this" no agency, no control, no considerations, skips calling out authority and goes direct
"Will you do this?" Direct, has agency but potentially confrontational if you say no
"I need you to do this" indicates their authority, direct, no control, could be inconsiderate to some as they overriding your priorities for their own
It can to be softened up with a question but if they really need you to do it I feel like your response also softens it up.
I think adding a acknowledgement of inconvenience, reason, urgency or explanation to it also helps.
"Hey Jim, I know you are working on X and this will be inconvenient for you but I need you to tackle Y" ideally a reason or compliment would be good too.
"I need you to do this because you have the most expertise on this and feel no one can do it well but you"
"I need you to do this right now. We are losing hundreds of thousands of dollars with the web server down" I feel this is an acceptable reason to demand to interrupt someone to take care of something that has a major impact on everyone
And for the life saving measures saying "I need you to evacuate this building immediately" is completely acceptable to me with no reason needed. Being butt hurt over a demand versus a kind request is better than dying.
I once got fired for not doing something the way the boss wanted, because at my previous job we did it the opposite way. He had explained that he wanted me to do it, but didn't say why, so I didn't remember. I too find that when I ask someone to do something, they're much more likely to do it right if I explain why, not just how. (Getting the method wrong is different from ignoring the request, but they both spring from the same underlying phenomenon -- we are likely to discard information if we don't know why to heed it.)