In the process of fermentation the heaps or boxes, the pulp adhering to the beans provides a medium at the correct temperature and pH, not only to liquefy the pulp, but to create the reactions within the cotyledon so vital to the production of good chocolate flavors.

During the first two days of fermentation, the sugars are broken down to about 2 percent, forming small amounts of ethyl alcohol and lactic acid and the temperature rises to about 45 degree C.
For the remaining period of fermentation, the temperature is maintained between 45 and 50 degree C and the quantity of beans must be sufficient to avoid heat loss. The pH rises from 3.5 initially to 4.5 then to 5.0, and the presence of oxygen during turning results in the formation of acetic acid.
The cotyledons absorb some of the acetic acid, and they also attain a pH of about 5.0.
If fermentation is extended beyond five or six days, spoilage organisms take over, with a detrimental effect on the final flavor of the beans, residual acidity due to acetic acid is a problem with beans from some sources, such as Malaysia and New Guinea.
Fermentation: Chemical Changes in Pulp