I don't understand how ore generation is handled

I'm looking at how ores are generated using datapacks and i'm looking at the vanilla datapack as an example and there are some things I don't understand like why are ore_diamond_buried and ore_diamond_large between layers -80 and 80 but there are no diamonds at layer 80 and layer -80 is not even a thing! I also don't understand how triangle distribution is done like how do you indicate where the 3rd vertex of the triangle is. I have looked at the wiki but it doesn't really help
Continue to help post