Like most chocolate candies, the recipe involves tempering the chocolate. If you've ever melted chocolate, then let it resolidify, you may have noticed it doesn't go back to the crunchy texture you usually expect. This is because only one of cocoa butter's six crystal forms has the properties we want.
Crystals are repeating patterns of atomic links. Depending on the angles between these links, the crystals have different properties. Here's a pair of examples:
On the left is a square grid, while the right is triangular. In addition to different angles, the atoms also have different numbers of neighbors, which can also affect the bonds.
Tempering chocolate involves heating it enough to break the bonds, then cooling rapidly to form the beta crystals that have the desired texture. The method I use suggests adding some unmelted chocolate during the cooling process, which partly cools the mixture further, but it may also provide a starting point for the crystals. Existing structures play a big part in how a crystal grows.
In the video below, the presenter drops a salt crystal into a supersaturated solution. The presence of the crystal causes salt in the solution to precipitate out and join the structure: