Besides the fact that capsaicin has antibacterial effects and exerts indirect disease-alleviating effects during bacterial infections (something our ancestors had to deal with a lot), eating chili triggers an endorphin high, but regularly eating chili makes you less sensitive and hence you have to eat more chili to get your little high. Taken together, these two properties of chili most likely have been the main drivers of it being adopted as a staple food in many cultures.
Besides the fact that capsaicin has antibacterial effects and exerts indirect disease-alleviating effects during bacterial infections (something our ancestors had to deal with a lot), eating chili triggers an endorphin high, but regularly eating chili makes you less sensitive and hence you have to eat more chili to get your little high. Taken together, these two properties of chili most likely have been the main drivers of it being adopted as a staple food in many cultures.