ummm...bodies reaction/natural defense against foreign particles entering the body - by secreting mucus which traps said particles and hardens upon continued contact with air?
This answer is neither particularily scientific or suited to a 4 year old, so I bow my head in shame and retreat...fwiw
Designed to trap particles and germs from entering when you breathe. I believe this is why you get congested when you are sick. It's the body's own natural defense against germs, just as a fever tries to slow down the spread of a virus (by making it too warm for the cells to reproduce).
EDIT: Whoa, didn't even read realityisterror's post before writing this, must be on the same brain frequency!
It's the bodies' reaction to an illness. More mucus is produced to get rid of the increased number of foreign bodies, bacteria, viruses or whatever. Drink lots of fluids when you've got the flu. Non-alcoholic of course. Unless you're really sick, in which case, knock yourself out with the numbing affects of booze.