Questions about what a productive cough actually is and where it comes from
When I'm sick with a productive cough, what is the stuff I'm coughing up (?)


If we're talking about a productive cough, you're most likely coughing up mucus, which is a thick (highly viscous) liquid that functions as both a lubricant to the internal behaviors of the body, as well as a defense against foreign particulates from getting too far within the body (e.g., breathing in dust through the nose and preventing it from traveling into the lungs). 




  is it coming from my lungs (?)


Mucus is produced all throughout the respiratory tract by mucosae. However, since you're talking about coughing up mucus (as apposed to it running from your nose), it's probably originating from the lower respiratory tract. So, yes!, it's quite possible that the mucus is coming from your lungs. 






  how come it doesn't hurt a lot and trigger a violent cough like if I got even a single drop of water down the wrong hole (?)


Hmm.. I think this is a bit more difficult to address. First off, as previously mentioned, mucus has a much higher viscosity than water does. Because of this, it could be that water more violently moves around while being coughed up, whereas mucus may remain more intact, thus causing less (increased) agitation.

It could also be that, because the trachea (the "wrong hole") isn't as accustomed to coughing as the esophagus is, then increased sensativity is experienced (relative to what's felt when coughing within the esophagus).