Why do chocolate bars (expensive ones like Lindt), cost less than the sum of thier ingredients?
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.