Each ore has a specific Y-level range where it spawns most frequently, like diamonds at Y=-59 and more. Certain ores generate in specific biomes like gold in badlands, and emeralds in mountain regions ...