Salt crystals are formed when sodium and chlorine bond together via a shared electron and these sodium and chlorine molecules bond with other sodium and chlorine molecules. Water dissolves the connection between the sodium and chlorine atoms, but when the water evaporates, the connection can re-establish itself.
Salt is made up of the elements sodium and chlorine, while water is made of hydrogen and oxygen. The bond between sodium and chlorine is weak enough that when the stronger hydrogen and oxygen combination is introduced, the sodium and chlorine bond can't maintain its integrity. The water molecules isolate the salt molecules from each other for as long as water is present. When the water evaporates, the sodium and chlorine molecules can come back together, allowing salt to grow in its naturally forming cubic crystals on any surface porous enough to allow the molecules.
A crystal is any hard, solid substance made of molecules bonded together in a specific repeating pattern, typically with straight edges and flat surfaces. Diamond and graphite, which are two different crystalline structures of carbon, are commonly known crystals. Geodes are a type of crystal formed when bubbles are trapped in melted rock after a volcanic eruption, while snow is crystallized water.