Many foods are a natural source of B12 because of bacterial symbiosis. It is produced by some of the gut flora of herbivores. Carnivores, of course, eat herbivores. Also algae and plants get it from symbiosis. So, by one route or another, animals must get vitamin B12 from bacteria (and archaea).