Aquafaba is rich with substances that enhance water’s foaming abilities because legume seeds like chickpeas and soybeans contain albumins and globulins, the same proteins found in eggs that make them so useful in creating culinary foams. They’re also rich in saponins, plant-derived organic chemicals that act like soaps* in that they can dissolve in both fat and water, and they, too, can help to form stable foams. The combined presence of albumins, globulins, and saponins in chickpea cooking liquid means that, when agitated, it will produce a stable foam.
“Saponin” is derived from “sapo” in Latin, which refers to soap.
Chickpeas happen to have a lot of albumins, globulins, and saponins, but other legume seeds also contain these components and can be used to make aquafaba. However, if you do use other legume aquafabas as egg replacements, you should expect them to produce noticeably different results; legumes will vary in their chemistry, and some aquafabas won’t produce as tight a foam compared to one made from chickpea aquafaba. Also, most studies show that chickpea aquafaba has been found to have the most “neutral” flavor; other aquafabas will look, smell, and taste different. Even different types of chickpeas produce aquafabas that have noticeable differences in color and the ability to produce foams.