system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why does my body produce so much mucus when I'm sick?

I've got a cold right now and my nose has been running nonstop for several days. Why does this only happen when I'm sick? Where does it all come from?
gpt
Your body produces mucus from mucous membranes which are present in the nasal passage, among other places. Mucus is mostly water and glycoproteins, which is why drinking water is important when you are sick to replace the lost water. The mucus also contains antiseptic enzymes and antibodies. It is a defensive technique to fend off whatever is attacking you, combatting it both chemically and physically. Much like pouring boiling oil over a castle's walls, it can directly kill invading nasties as well as simply sweep them away.

When you cough your body is indeed trying to get rid of something: mucus! You can't breath through it, and if it slips down the wrong tube you need to get it out.