Why do chocolate bars (expensive ones like Lindt), cost less than the sum of thier ingredients? I am a bit of a mad scientist, experimenting with recipes and generally trying to make my own versions of things at home (ice cream, cold drinks, etc.).

I have long been interested in chocolate. I absolutely love the stuff, and want to try and make some. I realize that (at home) you won't ever make silky smooth "shop bought" chocolate, but the basic idea should still resemble chocolate.

Taking basic ingredients into account, cocoa butter, cocoa powder and usgar, the math just does not work for me. The cost for the amounts that would be yielded, works out to be drastically more per gram than even some of the expensive store bought options. I am not attempting to make chocolate at home to "save money". I am curious and would like to choose my own ingredients. 

The math: (in my Currency: ZAR - South African Rand)


100g Cocoa Butter : R100
Cocoa Powder : R50
Sugar: R10


Lets say the above would yield about 150-200grams of chocolate. Let's call it R160 for 200g home made chocolate.(R80/100grams)

Lindt sells for R40/100grams?

I understand that big industry can buy ingredients cheaper, but by this big a margin. They still have to produce, package and re-sell it through various middlemen to get to R40. What do they actually sell it for before retail and handling... R20? R25?

Other milk chocolate producers obviously add milk, to up the volume with cheaper ingredients, but the math still does not compute for me, as those bars are a fraction of the cost.

What am I missing?
The cost of food, even ingredients, is often dominated not by the cost of production, but by the costs of transport, storage, waste, and sales. 

Sugar is a cheap commodity - you pay a typical bulk foodstuff markup compared to what they pay, because essentially everyone buys it, and there are economies of scale at all stages. 

Cocoa powder is still common but less so: there's less price pressure (and less competition), so retail profit margins can be higher. There are still economies of scale but less so (e.g. a supermarket will get a box of packs of cocoa powder, but a pallet of sugar, cheaper and easier to handle. Lindt will get it by the truckload, as with sugar. It's also sold by chocolate manufacturers in many cases. 

Cocoa butter is a niche product. You can't just go to any supermarket for it, but need a specialist. Margins are high for you - but chocolate manufacturers still benefit from economies of scale.

Chocolate, even decent mass-market chocolate, is on a par with cocoa - popular, but not as major a food as sugar. And it even happens to be close in price to cocoa - partially coincidence of course.