Underground Ecosystem

In a planet there is pocket of air,sometime there is lava,sand,ice or but other times there is ocean of salt water and non salt water this could be where life has started but the ecosystem in this place is very fragile depending of the size if there is overpopulation of a species that its like a major extinction,size is also limited because of the space,some pockets are connected to other pocket due to something,many diffrent species from these pockets will meet and its like south america connecting to north america so you could se this pockets as continent aswell,maybe air is a problem since there is no light to photosynthesis but maybe there could be a type of species that produce light and plants have to adapt to that light.