It has to do with perceptions. Most customers are unaware of the wholesale costs of foods or wines. Their familiarity is with retail prices and the effort needed to fix a meal or to pour wine.
If I order a steak, baked potato, and a salad, I know that the retail cost of the steak, potato, greens, and dressing is much less than they will charge me for the meal, but when I factor in cooking the steak, baking the potato, cutting the greens and also the clean up involved afterward, I am more than happy to pay two to four times my retail cost of the ingredients because of the effort it has saved me.