History and Culture
The carob tree's origin is in the hot, dry climates of the Mediterranean and Middle East, where the pods have been an important crop since time immemorial. One of our earliest surviving works of literature, The Epic of Gilgamesh, features a carob tree in a kind of Garden of Eden. Extremely drought resistant, even when other crops failed a plentiful harvest of wild carobs would drop from the tree, ready to eat. The wild abundance of this nutritious food has sustainanced ramblers, travellers and wamdering mytics for eons too.
Saint John the Baptist was said to have survived in the desert eating "locusts and wild honey". The locusts he ate may be the insects, but carob pods where colloquially called "locusts" as well, because they resemble these when hanging from the tree. Both the insect and the pods were one of the few things one could find to eat in the desert, so it's uncertain which the biblical texts were referring to, but this is the reason carob is also know as "Saint John's Bread". From here we get our name: the Maori word for locust is Kapakapa.
The carob tree is the origin of our measure of gem weights and gold purity. In ancient times, carob seeds - small, readily available and remarkably uniform in size - made a convinient and impartial reckoner of weight by their number. Similarly, pure gold today is still known as 24 carat. This is taken from the Solidus, a Roman gold coin which equalled the weight of 24 seeds.
The earliest culinary records of carob are from Mesopotamia, where it was prepared to makes sweets and juices. Ripe carobs straight from the tree are sweet and sticky, almost like toffee, and early records from Mesopotamia see it used to make juices and sweets. It's a traditionally taken as a drink during Lent, Ramadan and Tu B'shvat. In the Near East, you can still find "sous" vendors today, men selling carob drinks from ornate canisters carried on their backs. Cyprus and Malta are famed for their carob, and there preparations from it are taken to soothe coughs and sore throats.
Cacao has been drunk in Central and South America for thousands of years, the first evidence for the preparation of cacao dating from 1900BC, in the Chiapas area of Mexico. Evidence suggests the plant may have been first domesticated further south, perhaps in Peru. Ancient texts record recipes for preparation of cacao drinks using maize, spices and honey, and the Aztecs are thought to have smoked it (mixed with tabacco - it doesn't burn easily on its own, I tried it). The bean was important to the Olmec, Aztec and Maya, and so valuable it was used as currency: you could pay tax with cacao beans and 100 or so might buy you a new cloak.
Cacao was an important element of Aztec religious life, with priests preparing cacao drinks and making offerings of the beans. The Spaniard, Hernan Cortes, noted that at a banquet Aztec emperor Moctezuma II took nothing but cacao, drunk from a golden goblet. The Mayans revered cacao, describing it as the "food of the goods", the bean features in some of their sacred texts and was associated with their agrarian deities. They also used cacao as a medicine and Mayan warriors carried little blocks of cacao as rations.
In the ancient world, cacao was primarily taken as a drink. Tejate, for example, still drunk in Mexico today, has origins in some of the earliest mesoamerican recipes. It's a blend of cacao, maize, the mamey fruit and flor de cacao (not related to the cacao bean). In ancient times, like today, drinks were frothed, either by whipping or by pouring of the liquid from a height, like a chai wallah. The cacao bean began to be prepared as the chocolate we know today after cacao was introduced to Europe by the Spanish. At first it was taken as a drink before being made into a solid product. It was with the growing sugar boom and development of milling technology that it was first formed into what we think of as chocolate today, quite different to what a Mayan warrior would have nibbled.