The Contrin Formation was formed in the medium Triassic, that is, roughly 240 million years ago. How? Through sedimentation of skeletons of calcareous algae on a low seabed.
To understand what happened, one must remember that these places, in that period, were at a different latitude, because the continental plaques keeps moving constantly. It was a hot environment, like those where nowadays coral reefs are formed in tropical seas. Water was shallow, and very porous algae skeletons made of calcium carbonate piled up on the seabed.
Millions of years later, those skeletons became rocks, which were traversed by hot fluids rich in magnesium due to volcanic activity. Complex chemical reactions developed and magnesium salts substituted a part of the calcium carbonate.
But the magnesium atom is bigger than that of calcium, hence it took up a lot of space that had been empty until then: the result of this chemical transformation is a rock - the Dolomia - that is quite dense, hence a lot harder to break. As millennia passed, erosion swept away a lot of sediments, but not those that had become very hard Dolomia. So they are still among us: on top of those that eventually became mountains.