Okay... here goes...
Cough is a defensive mechanism which involves a cycle of deep inspiration followed by an abrupt explosive expiration of air.
Prior to understanding anything further, the respiratory tract are full of defensive structures that helps prevents and filters foreign bodies or particulates from the air that we breathe in. One of such is the coughing mechanism, the other familiar principle, is the sneezing reflex. Much like the gastrointestinal tract where there is acid in the stomach and alkali in the intestines to neutralize the necessary bacteria that attempts to breach our immune system.
The difference between the cough and the sneeze reflex (aside from having different nerve endings) is that cough is more for the clearance of foreign bodies that have reached the lower respiratory tract whereas sneeze is more for the clearance of the upper respiratory tract (explaining why we can sneeze with our mouth shut, but we cannot cough it out with our mouth shut).
There are two types of cough, the dry cough and the wet cough.
Dry cough - no phlegm is produced, one have the urge to continue coughing as they can FEEL something in their throat - the FEEL mechanism is that the tumor or the obstruction is encroaching towards the nerve endings that is responsible for the coughing mechanism.Usually indicates heatiness, obstruction in the airways or tumor.
Wet cough - phlegm is produced, and there are many colors, drs usually ask what color to indicate what kind of problem it is, if it is green (bacterial infection), yellow (allergy, or infection), red (blood) and white (mucus).These usually indicates upper respiratory tract infection (URTI), commonly the flu, and lower respiratory tract infection (LRTI), commonly pneumonia, lung abscess, bronchiectasis or asthma (not an infection, more of an allergy).
In summary, since coughing is a defensive mechanism for your body in an attempt to get something out that is stuck in your throat, most doctors would not advocate treatment by giving cough suppressants, unless it is a dry cough (by means that there is no point coughing, since you won't be able to cough up the tumor) OR after abdominal surgery (the act of coughing, which reinforces the abdominal musculature might open up the stitches)
And since the above explanation related to you, tells you of the nerve endings that are responsible for initiating cough, these cough suppressants will enter the brain through the blood brain barrier and enter a certain structure called the cough center in the brain. It will suppress the cough center and increases the threshold for coughing. Since the sleep center is also nearby the cough center, and given that most cough drugs will stimulate the sleep center, this explains why we often feel drowsy after taking these cough mixture and given the advice not to operate machineries or drive after taking the medicine.
I hope the above explanation helps. I have long left med school, so my explanation would not be that book based anymore, so sorry if you find the text quite not by the book