Compare the per-cup cost of espresso and drip coffee.
Espresso and drip differ in dose, not in bean price. A double shot uses around 18 grams of coffee against roughly 12 grams for a mug of drip, so the espresso costs half again as much before anything is added. What usually decides the comparison is milk: 180 ml in a latte is often a third or more of the drink's total cost, which is why a straight espresso can be cheaper than drip while the same shot in a latte is nearly double. Machine purchase and maintenance are excluded here, and they matter — an espresso setup carries far higher capital cost than a drip brewer.
Bean cost
Cost = dose grams x (bean price per kg / 1000)
Espresso drink total
Total = bean cost + (milk ml / 1000) x milk price per litre
The milk. At 180 ml a latte contains more milk by volume than coffee, and milk is priced per litre rather than per gram, so it routinely accounts for a third or more of the ingredient cost. A straight espresso removes that entire component.
No — it compares ingredients only. Espresso machines and grinders cost far more up front than a drip brewer and need descaling and occasional servicing. Amortised over a few thousand drinks the difference is modest, but over a few hundred it dominates the per-cup figure.