Usually, citric acid. Look it up, there's tons of info. For the extreme-pucker-up candies, there's malic acid, which is so strong that dentists use it to dissolve peoples' enamel before tooth surgery.
The sour tase that results when one ingests a Warhead, is caused by the reaction of the various acids contained in the candies. These include citiric acid, Malic Acid, and Ascorbic Acid.