While granite, quartzite, and marble are all forged deep within the earth’s crust, onyx is born right on the surface. Onyx forms from spring water or groundwater that has an abundance of calcite dissolved in it. When this water emerges at the mouth of a spring, the minerals precipitate out and build a crust of calcite crystals. Over time, more water flows by and more minerals settle out. The variations between the layers are caused by differences in the water flow rate and small amounts of impurities. In its most pure state calcite is white or clear, but it’s easily tinted by minor amounts of other minerals.
The most common color of onyx is a warm honey color, which is caused by iron oxide. The flowing layers of onyx reflect subtle variations in the spring water, and add an artistic quality to the patterns and bands. Slabs of onyx are made by slicing down into the layers, revealing thousands of years of deposits.
Onyx can also form inside caves or in other openings in bedrock. Veins of banded calcite can be found in fractured limestone, or even in volcanic rocks. Basically, beautiful formations of crystals can be created anywhere that mineral-laden groundwater flows. All it takes is the happenstance to discover the underground cache.
Travertine is formed in the same manner as onyx. The main difference between travertine and onyx is that travertine has a porous, lace-like texture while onyx is smooth and non-porous. Aside from that, the two stones are similar.
Link by : https://usenaturalstone.org/the-mystique-of-onyx/