The sugar in the syrup forms a protective layer over the irritated mucous membranes in the throat, keeping it moist and thus reducing coughing .