This won’t be news to anyone, but what you pay for an item of food at a restaurant, say a plate of eggs, is not the same as you would pay to buy the ingredients at the grocery store. It’s usually more (that also won’t suprise). The food is marked up to take into consideration the labor involved in the preparation, the energy used, the rent on the building, the cleanup. Plus, restaurants are in the business to make a profit (that part might be news to some restaurateurs) so a certain part of the percentage added on is meant to go to the bank.
But not everything is marked up the same way. Some food items — those eggs, for example — may cost you a lot more, statistically speaking, than a fine foie gras. This article from WiseBread lists some common food items that you may be paying to much for if you order them in a restaurant.