Runny Nose
Everything in your body tries to eliminate the illness's source when you're unwell, but it can usually only do it in a disgusting way. Your body needs to produce more mucus when you have a runny nose in the hopes that whatever infectious organism is inside of you will become stuck and leak out.
The pathogen causing your illness was able to bypass the body's natural filter, the mucus lining, when you had something like a cold. In response, your body produces cytokines, which are proteins that can travel between cells and transmit signals all over your body. They instruct your immune system to produce more mucus in this instance.
Extra mucus is utilized to drain out any impurities or pathogens that may have contaminated the mucus lining and clean it. In essence, it's like your body is attempting to power wash itself from the inside. You would be more likely to either get ill or stay sicker without this extra mucus production.