His experiment was most likely designed to demonstrate the law of conservation of energy, which states that energy the total energy of an isolated system remains constant; it is said to be conserved over time. This law means that energy can neither be created nor destroyed; rather, it can only be transformed or transferred from one form to another. So, he was trying to demonstrate that the amount of heat energy released was equal to the number of calories (amount of energy) stated to be in the candy bar.