Somewhere in that chain a maker may reach for alkali. Cocoa nibs, or the beans before they are shelled, can be heated with carbonates or hydroxides, which lifts the pH toward 7 or 8.
The reasons are colour, taste, and how readily the powder will disperse in water. The step is optional, which is why two tins of the same legal food can look and taste quite different.
US regulators allow the treatment and then fence it. For each 100 parts by weight of nibs, the total alkali may not exceed the neutralizing value of 3 parts of anhydrous potassium carbonate. The permitted list is short and chemical: ammonium, potassium or sodium bicarbonate, carbonate or hydroxide, or magnesium carbonate or oxide.