system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why are mineral ores found in the form of veins?

Like, besides where did each mineral even come from, what causes it to be a certain length embedded in rock?
gpt
As tectonic processes move the crust around, smooshing it together, bending it, stretching it etc, it also has lots of fluid moving through it. Some are hot, some are cold, some are water based, some are magmatic. They can have wildly different chemistry. As they interact with different rocks at different pressure and temperatures those fluid can dissolve some things. And like putting milk in chocolate cereal - some stuff dissolves into the fluid and others don't. 

So while a rock might only contain, say, 0.003% gold, hot fluids with the right temperature, pH and other conditions might be able to dissolve the gold and not much else. That will remove the gold from the rock and put it in the fluid.

As the fluid moves through cracks and other fluid pathways it can cool down or change its solvent properties, and particular minerals will get dumped out of it in highly concentrated volumes.