Gelatin is a protein that is derived from collagen in animal bones, skin, and connective tissue. It is used in candy production as a gelling agent to give candy its texture and shape. It also helps to extend the shelf life of candy.