A hot chili feels like fire in your mouth because its chemical, capsaicin, switches on the nerve sensors that detect real heat.
Birds' heat sensors ignore capsaicin, so they gulp chilies down.
That may suit the plant: the burn keeps away mammals, which chew up seeds, while birds swallow seeds whole and pass them in droppings far away, still able to sprout.