Chili peppers contain a chemical compound called capsaicin, which is part of a group of chemicals that give chilies their individual taste and heat profile.
Capsaicin can activate neurons in the diaphragm, which contracts and causes hiccups. Capsaicin is also an irritant.