As with any step of creating mezcal, how it is done has an impact on the flavours of the end product. The most traditional way of baking an agave is to this day still the most widely used, which is in a dug out cone shaped earthern pit. Some producers however do use clay or stone ovens above ground.
The earthern pit has been used for hundreds of years around the globe for cooking. Some producers line their pits with stone, so there is no contact between the agave hearts (pinas) and the soil, this will of course alter the flavours and the cooking time also, however other producers might not line their hornos therefore allowing heat and smoke to escape through the soil.
The cooking is done by starting a fire in the bottom of the pit often using the pencas and then using either burning wood or volcanic rocks/river rocks. Any of these will of course alter the flavours again.
Sometimes the pencas are used to separate the burning rocks/wood from the pinas, as they would otherwise receive more of a toasted flavour rather than baked, but again, this is the beauty of Mezcal, as it is always different.
Once covered with earth, sand and pencas it is left for days (~4-6 days) to make sure everything is cooked through, caramelizing it.