Smoke alarms can work in a few different ways; the most common are optical, ionization, and air sampling detectors. Optical detectors are generally the best for not going off over minor issues like smoke from cooking; ionization alarms are cheaper but so sensitive that they are prone to nuisance alarms from minor smoke from cooking and toasting food.