The processing of high quality chocolate that meets strict Kashrus standards [ought not be] a formidable challenge
Chocolate is derived from the seeds found within the fruit. The seeds are found within a jelly-like liquid, somewhat like the seeds in a rock-melon or honey-dew. The fruit is harvested, split apart and the jelly with the seeds are allowed to ferment naturally. This fermentation is critical to the development of the chocolate flavour. The beans are then roasted and broken into small pieces, nibs, which are ground, producing a viscous liquid, chocolate liquor.
Cocoa beans are grown exclusively for the purpose of making chocolate, and should accordingly be deemed a fruit even in its processed state. Dayan Gavriel Kraus in Mekor Habracha (Chpt. 21) argues that the Beracha must therefore be, HaEtz. Rav Moshe Feinstein disagrees; (IgMoshe O.C. 3:31) [see also Mishna Halachos Vol. VI Ch. 38; Tiferes Tzvi Ch. 6 from Rabbi Kornmehl.]
Under intense pressure, the chocolate syrup derived from grinding the chocolate seeds will separate into oil, cocoa butter; and powder, cocoa. Cocoa butter is almost flavourless and melts at about human body temperature thereby offering its remarkable sensation of melting in the mouth. Chocolate we eat is a finely balanced mixture of cocoa butter, cocoa powder, sugar and some flavour; milk chocolate also contains milk powder. Chocolate also contains an emulsifier to ensure it retains its smooth and creamy texture. Lecithin is often used as an emulsifier (it is derived from soy and can also contain animal-based fatty acids.) Chocolate certified for Pesach does not use lecithin and may have additional (expensive) cocoa butter. Other emulsifiers, rarely used in chocolate, can be derived from animal fats.
Dutched cocoa is processed with alkaloids to adjust its flavor and colour.
White chocolate contains no chocolate powder. It is made with milk, cocoa butter, sugar and vanillin.
Compound chocolate has non chocolate vegetable fats added to it, it is diluted chocolate, and is less expensive.
Whey, derived from cheese production, might also be an ingredient in dairy chocolate. Unless cheese is made with Jewish participation, it is not Kosher and the whey derived from it wil also be deemed to be non-Kosher.
Milk powder produced on shared equipment can become contaminated with non-Kosher flavour.
Making chocolate delectable requires a 24 to 96 hour process called conching which essentially heats and pounds the chocolate to reduce the crystalline structure, making it extremely smooth.
Tempering chocolate ensures that as it cools, a fine, even-grained texture is retained and that the chocolate will not bloom, i.e. form a whitish colouration. Adding an emulsifier such as lecithin also assists to prevent bloom.
Rav Tzvi Pesach Frank (Har Tzvi Reponsa 103 and 104) rules that powdered milk is not subject to the decree of Cholov Akum. Thus milk chocolate, being made with powdered milk, may be eaten by those who are particular to use Cholov Yisroel.
Water is detrimental to the manufacture of chocolate. It interferes with production. Chocolate becomes an irreversible, brittle, ugly mass with even the tiniest drop of water. It is therefore difficult to Kasher machinery for Kosher production. Kashering with water is not a favoured option. Kashering with a flame (Libun) is not practical. Kashering with liquids other than water is not agreeable to many Poskim. Cocoa butter may not even be considered a liquid since it is a solid at room temperature (Igros Moshe Y.D. I:60). ref 45892311004