It is up to the DM.
There is no uniform answer to what exactly happens with the material and thus it is up to DM-Fiat. We know that:
If a spell states that a material component is consumed by the spell,
the caster must provide this component for each casting of the spell.
We have to look at each spell description individually for example let us look at Awaken:
After spending the casting time tracing magical pathways within a
precious gemstone, you touch a Huge or smaller beast or plant.[...] - (an agate worth at least 1,000 gp, which the spell consumes)
and compare it with Clone:
This clone forms inside a sealed vessel and grows to full size and
maturity [...] (a diamond worth at least 1,000 gp and at least 1 cubic
inch of flesh of the creature that is to be cloned, which the spell
consumes, and a vessel worth at least 2,000 gp that has a sealable lid
and is large enough to hold a Medium creature, such as a huge urn,
coffin, mud- filled cyst in the ground, or crystal container filled
with salt water)
It seems intuitive that the flesh consumed in the clone spell transforms into the new body. But the byproducts of the agate are unclear. All assumptions like "it fizzles into light of the colour of the agate." have little basis in the text - we merely know that a transformation happens, and the spell is the product of it.
What does it generally mean to consume something, and how does it apply to this case?
Consuming is a process of transformation, it involves the use of a quantity of a good in the use of creating another good. Food and fuel into energy, and byproducts. Energy into movement and byproducts, a raw material, time, and energy into a consumer good etc.
I think nobody would question that you can use the cow manure as a valuable product in agriculture even though the cow consumes the food and converts it into energy. Any gardener would know that buying good compost, that is the byproduct of consumed food, is pricey.
So we are back to DM-Fiat. I think it is intuitively sensible to rule that the ruby dust used in Continual Flame transforms into the flame itself. But when a player asks me what happens to the sacrificial offering used in Divination while the incense burns up, I make something thematically appropriate up on the spot - and that could mean that the valuable offering remains and somebody else could theoretically recycle it.