Researchers have determined that a fugu's tetrodotoxin comes from eating other animals infested with tetrodotoxin-laden bacteria, to which the fish develops insensitivity over time.[10] Whether tetrodotoxin is sequestered from or produced by symbiotic bacteria is still debated.[11] As such, efforts have been made in research and aquaculture to allow farmers to produce safe fugu. Farmers now produce poison-free fugu by keeping the fish away from the bacteria – see § Aquaculture below.[10]
yup, another toxin called batrachtoxin, comes from eating specific beetles, by the frogs. once they are fed from a non-beetle diet they arnt poisonous.
if it were something like a cane toad, they dont need other animals to make thier toxins.
I mean, it's gonna depend on the specific ant species. Some ants don't sting at all. Some ants only have formic acid. Some ants' venom tickles. Some ant venom can kill you.
But to quote Wikipedia for one of the latter, the Jack Jumper ant:
The retractable sting is located in their abdomen, attached to a single venom gland connected by the venom sac, which is where the venom is accumulated. Exocrine glands are known in jack jumpers, which produce the venom compounds later used to inject into their victims.
I don't have much deeper knowledge than that, but at that point, it might as well be a mixture of some compounds that they ingest and some that they produce from simpler compounds. At the very least, they would need to ingest appropriate atoms/molecules in some form, like for example nitrogen, which is contained in relatively many of those compounds.