It is not thermodynamics that controls crystal formation at the atomic level, but quantum mechanics. Large crystals, from diamonds to clear ice crystals are a macroscopic manifestation of the underlying quantum dynamical level. The molecules that build up the crystal have such field properties, dipoles and quadrupole and even higher moments that have attractive and repulsive fields that can fit, like LEGO, in stable symmetric configurations.
Theses fields arise even though atoms and molecules are neutral, because the electrons around the positive nucleus are not in a spherically symmetric charge distribution, but have deformations due to the quantum mechanical levels of the electrons composing them. These deformations create spill over attractive forces between molecules that also carry symmetries in space. Here as an example you can see an illustration of molecular orbitals for a specific molecule. An orbital is the quantum mechanical locus of the probability of finding an electron there , and reflects the square of the quantum mechanical wave function.
Complete acetylene (H–C≡C–H) molecular orbital set. The left column shows MO's which are occupied in the ground state, with the lowest-energy orbital at the top. The white and grey line visible in some MO's is the molecular axis passing through the nuclei. The orbital wave functions are positive in the red regions and negative in the blue. The right column shows virtual MO's which are empty in the ground state, but may be occupied in excited states.
The LEGO analogue should give you an intuition of how , if specific receptors and extrusions exist in more complex molecules, in various symmetries, different shapes can be built up. The electric field attraction is what holds everything together, positive regions joining with negative ones.
Forming a crystal from a precipitate should give you an intuition of how the molecules "know" to form long range in space patterns. First it is a statistical probability of small crystals forming given the right conditions. If the solution is saturated this happens randomly, the receptors and bumps happen to coincide, are attracted and stick, and the next molecule comes ..... Seeds from the random crystallization can be used to deliberately make large single crystals.
Thermodynamics enters in the environment in which the crystals may grow, temperature and pressure pressure . Also the chemical environment is very important for the growth. For example in the question about calcite in your comment:
Calcite forms from a poorly ordered precursor (amorphous calcium carbonate, ACC). The crystallization process occurs in two stages; firstly, the ACC nanoparticles rapidly dehydrate and crystallize to form individual particles of vaterite; secondly, the vaterite transforms to calcite via a dissolution and reprecipitation mechanism with the reaction rate controlled by the surface area of calcite. The second stage of the reaction is approximately 10 times slower than the ﬁrst. However, the crystallization of calcite has been observed to be dependent on the starting pH and presence of Mg in solution A neutral starting pH during mixing promotes the direct transformation of ACC into calcite. Conversely, when ACC forms in a solution that starts with a basic initial pH, the transformation to calcite occurs via metastable vaterite, which forms via a spherulitic growth mechanism. In a second stage this vaterite transforms to calcite via a surface-controlled dissolution and recrystallization mechanism. Mg has a noteworthy effect on both the stability of ACC and its transformation to crystalline CaCO3, resulting in the formation of calcite directly from ACC, as this ion unstabilizes the structure of vaterite.
So although the inherent symmetries are a quantum mechanical expression of the molecular energy levels , the crystal creation process is complex and dependent on many variables.
The different symmetries expressed indicate that there are more than one possibilities of minimizing the energy for that particular molecule as it matches up to form the crystal structure, and it will depend on the seed, the first few molecules that join up in a particular configaration.