It is mentioned in the Gospel of St. Matthew in the parable of the prodigal son who was forced to eat food intended for pigs. It turns out that in biblical times, carob was not considered a valuable food for humans, but for pigs. It could only be eaten by very poor people; it was the bread of the poor.
Another biblical passage mentions John the Baptist who, while in the wilderness, ate locusts. This is possible because locusts were eaten by the people of that time (only certain types of locusts and only the abdomen) and this was not part of the public debate. Since locusts appeared only periodically in swarms in the desert regions of the Holy Land, it is believed that John the Baptist ate carob.