The key organism in this ecology is yellow mold. It is central to two diverse groups — giant ants and troglodytes.
One of those wonderfully tantalizing monster descriptions that set my imagination on fire can be found in LL's entry on giant ants:
They will tend to only have a small amount of treasure around, from past opponents, but in some rare instances giant ants will inexplicably mine precious metals.I've fiddled with this idea before but have never tried to explain the behavior. Carpenter ants harvest leaves in order to grow fungi that they then use to feed the colony. If some giant ants had a similar behavior there is plenty of potential for explaining this inexplicable mining instinct.
In this particular case, the giant ants harvest the leaves from the yellow musk creeper. This vicious plant has no real defense to protect itself from the giant ants, whose central nervous systems are not developed enough for the creeper to take full advantage of. However, the chemicals that would normally result in a yellow musk zombie do alter the behavior of the giant ants. In addition to the leaves from the creeper, they also begin to mine for precious metals. This, in turn attracts humanoids which can fall victim to the yellow musk creeper.
After harvesting the leaves, giant ants dust them in yellow mold spores. The combination creates a very fertile ground for the growth of yellow mold. The giant ants then feed on the mold, its spore and a liquid that they create by combining the mold with giant ant feces. This liquid is mostly used to feed giant ant pupa, but is also used by the ants to prevent the yellow mold from releasing its spores and protects flesh from the acidic touch of the mold.
Troglodytes are a subterranean sub-species of lizardmen, who all have organs that produce smell to communicate tribal affiliation, willingness to mate, anger, etc. Due to their oft dark environment, this gland came to grow all over the body of the trog, increasing the distance from which these odorous communications could be detected.
What these glands did not do however, was develop the infamous stench that causes humans and demi-humans to save vs. poison or suffer a -2 on attack rolls. This ability is the result of purposely ingesting yellow mold as part of the troglodyte diet. The ingested spores from the yellow mold alter the chemicals produced by the glands, producing a toxic mix for humans and demi-humans.
As a result, troglodytes like to live in proximity to both giant ants and yellow musk creepers. They collect the giant ant liquid to protect themselves from the yellow mold that they harvest for producing their infamous odor.