Doctors used to do it on their own when they knew that the patient wouldn't recover.
Triage (and triage WOULD happen in a great disaster or pandemic) sets those who have only a tiny chance of getting better aside to die so that medicine and health care can be focused on those with a better chance of living. Harsh, but at times necessary.
My wife and I have "DNR" on our Medical Directives; I hope that I never have to make the decision to "pull the plug" though.