system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why do people usually have to fast before an operation, and how does this work in case of an urgent, unplanned operation where the person has not been fasting?
gpt
Because of the general anesthesia. General anesthesia and the intubation process can make people vomit or regurgitate, and since you're unconscious and your normal reflexes are suppressed, you could aspirate stomach contents into your lungs, which can be fatal. Also for surgery on part of the digestive system itself, obviously you don't want food in there while surgeons are operating.

As for emergency surgery, doctors will determine the risk of performing the surgery right away vs the benefit of waiting. Usually if it's that serious that you need emergency surgery right away, they're just going to do it. Aspiration is pretty rare anyway, so if you can avoid it, fine, but if you're gonna die without surgery, they don't really have a choice.