When you freeze water, are the minerals separated from the molecules of the water? (When I freeze store-bought water and it then thaws out, there is a glob of nasty looking minerals that settle to the bottom of the bottle.)
When water freezes, it forms ice crystals. Crystals are very orderly arrangements of molecules in which each molecule has a particular position and orientation. Each crystal grows from a tiny initial seed crystal by adding one molecule after another to the surfaces of the crystal. Since each molecule that attaches to the crystal must fit into a particular position and have a particular shape and orientation, molecules that are different from those in the crystal tend to be excluded from the growing crystal. Thus an ice crystal that’s growing in dirty water will nonetheless consist almost exclusively of water molecules. Only if the water freezes very quickly will it trap large numbers of impurities by not giving them time to get out of the way. Even gases are excluded from the ice, which is why air bubbles often appear as water freezes into ice.
The minerals that you see in the thawed bottle of water were originally dissolved or suspended in the water. But as the water froze, the ice crystals excluded those impurities and they remained in the liquid portion of the water. Eventually the liquid portion of the water dwindled away and the minerals were forced to come out of solution as solid particles. When the water thawed, those minerals failed to redissolve (they’re often only weakly soluble in water and have great difficulty redissolving).
This phenomenon whereby crystallizing a liquid separates out its impurities is very useful in chemistry—many important chemicals, notably medicines, are purified in this manner. Similarly, freezing water is an important way of purifying it in some locations—native people in cold countries have used sea ice (the pure ice that forms when seawater freezes) as a source of fresh water for centuries. And you may have noticed that when you eat frozen juice, you can suck away the sweet flavored portion and leave behind only the pure ice portion—because the sugar and flavors have been excluded from the pure ice crystals during freezing.