Sugar and salt are both hygroscopic, meaning they will readily take up water under certain conditions of humidity. In baked products, they act to retain moisture, extending shelf life. In items such as hard candies, however, this attraction of moisture acts to begin to break down the structure of the candy or other item, causing it to become soft and sticky.