Sugar bloom happens when chocolate is exposed to moisture. It's the result of water (such as condensation) interacting with the chocolate. If chocolate is stored or exposed to warm or moist conditions, moisture collects on the surface of the chocolate and draws out the sugar, which then this dries and crystalizes on the surface, giving the chocolate a white and grainy appearance. Although it looks unpleasant, the chocolate is still safe to eat.