Hydrothermal veins are a combination of the two ways that crystals form. Magma contains water as well as molten rock. Because it is underground, and under tremendous pressure, the water stays a liquid. At very high temperatures and pressure, that water can dissolve quite a few minerals. As the magma cools, the last part that is still a liquid is the quartz and the high temperature/high pressure water. They flow into cracks in the surrounding rocks, where they cool. The quartz starts to solidify quickly, but the hot water keeps some of it dissolved. As the water cools, it becomes supersaturated just as the epsom salts did in the Growing Crystals from Solution activity. It can form beautiful quartz crystals, along with crystals of garnet, calcite, sphalerite, tourmaline, galena, pyrite, and even silver and gold.