Where does the mucus that causes stuffy noses come from?

Mucus. The actual mucus membranes that line the sinus cavity are responsible for producing the mucus.
Lining is irritated. If one has allergies, or infection in the nose, sinuses, throat, or the lungs, the irritated cells lining the inside of those areas will make more mucus, which is clear but can have some color. If lots of white blood cells, plus dead/dying germs and respiratory lining cells, get mixed in with mucus, one has phlegm. If one drinks adequate water, both phlegm and mucus should get more and looser.