Olives are stone fruits with a very tough skin. They are inedible until fermented. There are two main types of olives the Spanish-style green ones and the Greek black ones.
The green olives are picked unripe and treated with a sodium hydroxide solution (lye) to break down a compound called oleuropein which has a very bitter taste and also inhibits lactic acid bacteria. It also softens the olive skins.This takes several hours, after which the caustic solution is washed off thoroughly. The olives are placed in brine and the natural fermentation sequence begins. Sometimes sugar is added to the brine to help start the microbial growth. Due to the low pH and salt, lactic acid bacteria and some yeasts replace the natural flora of the fruits. Air is kept out of the vat so that spoilage moulds and yeasts cannot grow. The process takes some weeks. The product contain 1% lactic acid and has a pH about 4.
The black olives are ripe and are not treated with lye. The fermentation is slower because it takes time for nutrients to diffuse through the olive skins into the brine for the microbes to grow on. A variety of yeasts are responsible for the fermentation process, with significant numbers of lactic bacteria present only if the salt content is less than 6-7%. The final product is much less acid than green olives (pH 4.5-4.8) and so more salt is usually added to prevent the growth of spoilage microbes on storage.