Nasal passages and lungs are lined with fine hairs, or cilia, that detect and sweep out impurities. How do they detect it? By sensing bitter tastes of the things passing through them (such as, say, nicotine). When these hairs taste something bitter, they increase their rate of movement, attempting to sweep out the bad stuff, according to a 2009 study published by the American Association for the Advancement of Science.