The body reacts to respiratory irritation by coughing: The mucus which is produced is able to remove foreign matter from the airways. So, coughing is a key protection reflex.
Conversely, unproductive ticklish coughs, i.e. a dry cough not producing any mucus, are just a torment. It typically occurs at the onset of bronchitis and occasionally remains long after a cold that has been overcome. Liquefying the thick mucus in the airways brings relief enabling it to be coughed up more easily.