The tree that produces pods used as a chocolate substitute is the carob tree.
Carob is the evergreen legume Ceratonia siliqua, native to the Mediterranean region and the Middle East. Its edible fruit is a long, leathery pod whose naturally sweet pulp can be dried, roasted and ground into carob powder. The powder is used in drinks, baked goods, chips and syrups as an alternative to cocoa.
Carob is not chocolate and does not come from the cacao tree. Its flavor is naturally sweet and somewhat caramel-like, while cocoa has a deeper, more bitter flavor. Carob also contains no caffeine and no theobromine, the stimulant that makes chocolate dangerous for some animals, so carob-based treats are sometimes formulated for dogs.
The seeds have a separate commercial use: they provide locust bean gum, a thickening agent used in food processing. The tree has also left a linguistic mark on the word “carat,” traditionally linked through Greek and Arabic to the reputedly uniform weight of carob seeds, though historical claims about perfect seed uniformity are exaggerated.