What process explains why certain minerals/elements stratify in the crust of the earth?


For example, why are there veins of gold, or certain areas of the world have lots of amethyst, or lithium. With all the mixing and moving of all parts of the earth over billions of years how do some things congregate instead of disperse?

Note: I do grasp why oil and coal are formed, I’m asking about the kind of minerals and elements that don’t have obvious biological origins.

In: 7

Impacts from asteroids and volcanic eruptions more or less explain the degree of stratification we see in minerals throughout the crust.

Also, just because a specific element isn’t getting extracted in a specific region doesn’t mean it isn’t there. Elements like Iron exist throughout Earth’s crust however it’s only in specific spots where it’s concentrated enough for economic extraction (cheap enough to mine).