It doesn't work exactly like in this image because there should be a small gap between where all the pieces join together. That small gap has the same volume and area as the one extra piece
Proxxxy is correct, you can see this happen if you drag the image into Photoshop and look at the frames. In the animation as the diagonal pieces re-join the bar there is a missing potion of chocolate that appears to fill in the gap.
Now excuse me while I put Hershey's and Cadbury out of business....