Judging by the bizarre nature of replication that took place due to Transporter malfunction in "The Enemy Witihin", it seems highly unlikely a Federation starship can just snap its fingers and "replicate" whatever it wants to perfection. OTOH, in "Catspaw" Korob and Silvia try to tempt Kirk's landing party with plates filled with gemstones, only for Kirk to claim "We could manufacture a ton of these on our ship. They mean nothing to us."
So it wasn't really clear how food, other supplies and spare parts are manufactured aboard space vessels. Did 23rd-century space vessels use replicators or something bulkier and more primitive? You could argue the food dispensers (like the one Kyle used to serve the Air Force security guard in "Tomorrow is Yesterday") were replicators, but there are people who say that TOS had no such technology. Even if the TOS era can be said to exhibit such abilities, it could be readily assumed that supposed replicators of that era would be much more limited than their TNG counterparts.