This is more an outline than an explanation, that's the problem with hard scifi. You can never really explain.
Imagine a world without magic but with adamantine spires. They’re tall, air-filled columns. Air convects heat well, meaning it’ll move around the column until the temperature is the same everywhere. If it succeeds, the inside of the column will be the average temperature along the outside surface of the column. How close it gets to this goal depends on the insulating value of the adamantine spire itself, but even if adamantine is only a wonky insulator, there will be a thermocline - a temperature difference - at the tip of the spire.
If you removed HFS when I said imagine a world without magic, the rule is deeper is hotter and the inside of the spire at the top will be hotter than the outside, because of heat convected from below. If you assumed HFS uses a kind of magic that’s exempt from removing, then the inside of the spire is cooler than the outside. Either way, you could paste peltiers all over the inside of the spire tip and use the generated voltage to electrolyze water. When chlorophyll does it, cracking water like this is the first step of photosynthesis. Obviously I’m going for adamantine: underground chlorophyll, but if that doesn’t work I can fall back on adamantine: structural support for underground chlorophyll. My goal is to have this underground chlorophyll be a primary producer for the cavern layers, but it can’t be releasing oxygen directly because it would have to oxidize the entire magma layer before any useful oxygen could reach the cavern layer, which would change the predominant minerals worldwide to things that simply do not exist in the real world. That's no good.
Luckily Toady included magmatic life -- fire snakes, magma crabs, etc. My copy of Life in the Universe,
https://books.google.com/books?id=bsZ49I84twEC, suggests the most appropriate life for magma is based on silicate polymers. It also calls it unlikely, but the crabs are there so obviously it's wrong on that part.
The basic building block of life (CH
2O) wants to be carbon dioxide and water, but living things spend their life avoiding that conclusion. If you’ll trust me, silicate (SiO
4) wants to be silica (SiO
2), which magmatic life will likewise avoid, but when it happens there’s no choice but for the reaction to release a fair amount of oxygen. Just like a human corpse doesn’t spontaneously explode into a cloud of CO
2 and water vapor, magmatic corpses are not going to explode into clouds of quartz and oxygen, but that’s the direction they’re headed in and they’re going to give off both in some quantity.
If the magmatic ecosystem is full of a rich microbial life that spreads by diffusion, similar to surface life, then it could diffuse up the magma pipes and meet inevitable death at the hands of the hostile environment. This would give off at least a little quartz, which under the temperature and pressure might accumulate on the walls of the pipe, explaining the obsidian shell surrounding each one. It would also give off at least a little oxygen, but realistically this couldn’t be free O
2 because everything is just too reduced down there. I think the best you can hope for are oxides useful for (hydrocarbon based) anaerobic respiration:
https://en.wikipedia.org/wiki/Anaerobic_respirationI’ll admit this is a weak point in my argument. Chemistry is hard and knowing that oxygen is released doesn’t mean it’s released in a way useful to life. I have found a few minerals that would decay in a way to provide some redox profit, but just as many with a tiny redox deficit. Therefore I have to invoke a quirk of making silicate polymers: If you want to make the chain longer, you free up oxygen, as noted, all the way until quartz, which is a perfect lattice, everything connected to everything else. Likewise, if you want to break a chain, you need an oxygen to cap the ends or you're in trouble. These are also known as anabolism and catabolism. Because statistics are a bitch, every once in a while you're going to have to break down a polymer and there's not going to be an oxygen handy from a nearby build up. Either you're stuck waiting for anabolism to proceed somewhere, to free up an oxygen, or you keep a reserve of oxygen on hand (stored in some way) for these temporary emergencies. So it's this reserve of oxygen, more than the decay of the silicate itself, which goes on to oxidize the cavern layers, but it still depends on the nature of the SiO
4 to SiO
2 decay for its existence.
So there are anaerobes, and the caves clearly have oxygen, which means the anaerobes are probably sequestered in poorly aerated soil, i.e wet and muddy, which is where they hide on the surface, as well. This could be to the ecosystem’s benefit because it also implements an oxycline. Using sulfur as the example again, sulfur oxidizing and sulfur reducing bacteria can toss the same bit of sulfur back and forth across an oxycline indefinitely, giving the sulfur more mobility than without the bucket chaining. IOW, the oxycline could be why there’s an ubiquitous underground ecosystem and not just little rings around the magma pipes where the combination of mine gases and magmatic detritus is just right for anaerobic life. The increased surface area would in turn allow for the better extraction of energy from said mine gases, resulting in a larger biomass overall. As a side effect, absorbing mine gases makes cavern air far more breathable than analogous air in the real world: The life keeps it clean.
In short, adamantine could be magmatic chlorophyll, supporting the magmatic ecosystem. Decaying microbial magmatic life, leaving behind obsidian detritus, could combine with mine gases to sustain anaerobic life in the caverns. This anaerobic life, hiding in wet and muddy soil, plays tag with aerobic life in order to maximize biomass. No muddy soil, no oxycline, no trees. Since "maximizing biomass" means "drawing down mine gases", as a side effect, cavern air is made more agreeable to surface life than our experience in the real world might suggest.
Of course, if you look up how much thermal energy is available it seems like this kind of life is impossible: Earth has 47 terawatts of heat escaping and 173,000 TW of incident sunlight, but hydrothermal vents (
https://en.wikipedia.org/wiki/Hydrothermal_vent) survive on similar flows, so something is possible.