What is the food chemistry of aquafaba?
Aquafaba in cooking generally refers to chickpea aquafaba, but the term generally applies to the liquid in which any legume seeds have been cooked. It contains starches and proteins which allow it to foam when whipped. I have seen aquafaba mostly used for foams in cooking, but it can serve as a replacement for egg whites in many recipes. Adding cream of tartar will greatly stabilize the foam. 

Here is a scientific description of aquafaba from wikipedia.


  Legume seeds, or pulses, are primarily composed of carbohydrates (starch, sugars, and fiber), proteins (albumins and globulins), and water. The carbohydrates are found in greater quantities than the proteins, while the starches consist mostly of amylose and amylopectin. A typical nutritional composition of chickpeas, is listed as 19% protein, 61% carbohydrate, 6% lipids, and 14% water. However, these amounts are approximate and can vary by variety.[22] During the process of cooking legume seeds, the starches in the seed are gelatinized, allowing the soluble parts of the seed to leach out into the cooking water. More material can be extracted from the seeds, if both the cooking temperature and pressure are increased, as well as extending the cooking period.
  
  Whipped aquafaba
  
  Once the legumes are cooked and filtered out, the water-soluble part left is aquafaba. Comparing the final composition of a cooked seed with a raw seed shows that under normal cooking conditions, approximately 5% of the initial dry weight has been transferred to the cooking water. The dry matter consisted mainly of carbohydrates (sugars, soluble and insoluble fibre) and protein. That ratio of soluble material is approximately the same ratio as found in the raw seed, However, fat and starch were not detected. A concentration of 5% dry weight to water is typical for aquafaba, but the solution can also be reduced to increase the concentration to 10% or more, depending on the application. This can be especially useful for applications where emulsification and viscosity are more important than foaming capabilities. The concentration can also be tailored to produce a more stable foam using less aquafaba by carefully filtering non-soluble material from the solution and adjusting the concentration to the application.
  
  The first peer-reviewed publication using the term "aquafaba" was recently published by Martin Reaney's group at the University of Saskatchewan (Canada). In this research, they have found that chickpea aquafaba from different commercial sources produces foams that vary in both properties (volume and stability of foam) and chemical composition. 1H-NMR was used to analyze the composition of aquafaba. NMR analysis revealed that the foam contained mainly polysaccharides, sucrose and protein. Protein separations by membrane filtration followed by SDS-PAGE and peptide mass fingerprinting were used to identify aquafaba proteins contributing to foaming properties. Reaney's group research showed that most of aquafaba proteins belonged to known heat soluble proteins such as late embryogenesis abundant proteins and dehydrins. Identified proteins also included heat shock protein, defensin, histone, nonspecific lipid transfer protein and superoxide dismutase. Major storage proteins provicillin and leguminin were also present. In 2015, it was theorized that the most likely agent that caused the liquid to foam was saponins. However, the group's research has shown that aquafaba foaming property is a result of the presence of saponins, carbohydrates and protein fractions.[citation needed]
  
  In general, the composition of aquafaba depend on: 1. processing methods (soaking, cooking and industrial dehydration), 2. conditions (pH, temperature, pressure and treatment duration), 3. genotype (Kabuli or Desi chickpeas), 4. additives, 5. protein concentration, and 6. carbohydrate type and concentration.