From wikipedia:
"Trace amounts of naphthalene are produced by magnolias and specific types of deer, as well as the Formosan subterranean termite, possibly produced by the termite as a repellant against "ants, poisonous fungi and nematode worms." Some strains of the endophytic fungus Muscodor albus produce naphthalene among a range of volatile organic compounds, while Muscodor vitigenus produces naphthalene almost exclusively".