Synthetic vanilla is derived from petrochemical processes. In the past it was synthesized from clove oil, or from the brown liquor used in papermaking processes.
Synthetic berry flavors are similarly concocted from chemical processes.
Castoreum, the compound you're referring to, has reminders of both of those flavors but is primarily used as an enhancer for them, or in perfumes. It's far too expensive and scarce to be used in the massive commercial factories that make our foodstuffs.