Because a restaurant will factor into what they charge you a markup on the food that has to cover their overhead (their building, heat, lights, etc.), their labor costs (the chefs and servers and cleaners and hostess), the things like plates and napkins and toilet paper and all that stuff, and the food itself (they need to make a profit on the food).