What Makes Candy Sour?

We have all had those pieces of candy that make us pucker up. You would think it is some kind of chemical you need a degree in chemistry to pronounce but usually it is just citric acid. Sometimes sorbic acid is also used.