Capsaicin, and related compounds known as capsaicinoids, give chilli peppers their heat when they are eaten. The capsaicin in chilli peppers excites pain receptors on your tongues, making chilli taste 'hot'.
The sometimes intensely hot sensation of spice we feel as spiciness comes from a chemical called capsaicin. Commonly found in chile peppers, capsaicin binds to our tongues and causes a painful sensation that we interpret as spicy.