The middle lamella is cementing layer between the cells. It is made up of $\mathrm{Ca}$ and $\mathrm{Mg}$ pectates. The basic chemical unit of pectin is galacturonic acid, which have the capability of salt formation with calcium and magnesium (an acid base reaction).