Customers can always tell the difference between quality and non-quality, and since manufacturing is actually a small part of the retail price, it's crazy to try to save money on quality.
On the other hand I've read accounts of people who've published through O'Reilly and were very happy with having a team of people to crunch through the layout, typesetting, etc.
That doesn't make book writing for publishers a good deal for anyone, by the way. Executing on a book contract is one of the lower effort/reward things you can do.
If you asked me what about a big cookbook with glossy pictures would make it cost more than a regular book, I'd go with the glossy pictures, not the mass.
This is because they have access to a traditional printer and are able to order the volume needed for that price. A print on demand book from amazon that is 200 pages, full color will cost ~$15/book. But, that price is fixed whether you buy 1 or 5000 copies. Add in amazon's cut and you're looking to make 30% for each sale on amazon.com. If they handle distribution to bookstores you're looking at a 10% cut.
This is the option available to most self publishers and the margins are not that much better than going with a traditional publisher. Especially, because the author needs to front all of the costs for editing, design, etc.
"Until one-day I got lucky. Just by chance I spoke to the print broker who actually worked on the exact bid for that famous book. And he told me precisely: that super amazing cookbook that I truly loved, which at the time retailed for $50 and had won every award imaginable, cost $3.83 per book to print, shrink wrap, and ship to the US. I thought he must be mistaken and I said so. “No way.” He replied, “well that was the first edition, I’m sure the cost has gone down since then.” He thought I was implying that $3.83 per book was too high!"
One implication of this is that the cost difference between digital and physical publishing is probably much less than most people think. While a weighty tome may literally feel like it's worth a hefty premium, this is due more to consumer psychology than anything inherent to cost of production.