1. There is probably a combination of real and synthesized food on the Enterprise. Picard's ship has a galley (Complete with a Whoopi Goldberg!), so we can make the general assumption that Kirk has one too.
As far as we know, Guinan never cooked. Even in the parallel universe of "Yesterday's
Enterprise", her establishment served MREs...
But we explicitly saw cooks doing their usual work aboard Kirk's ship in the 2290s, making it all the more likely that such things took place in the 2260s as well.
But, thanks to Charlie X, we know they synthesize turkey.
But whether they do that onboard, or in the factory that packages the stuff for the mission at Starbase 42, we don't know.
2. For some strange, unknowable reason, dilithium is impossible to replicate. Whether this be the instability of the nucleus or because Kirk said so, you just can't make dilithium.
There is no real reason to think dilithium could not be replicated.
From various episodes, we know that functioning neural tissue can be replicated but people still don't replicate replacement brains; that functioning phasers can be replicated but people still store readymade phasers in locked cabinets; and that tools can be replicated as needed but the engineers still haul entire belts full of different tools, rather than a single tool that can become anything at the push of a button, exocomp style.
It's simply that replication is sometimes less practical than other manufacturing methods, not that it would ever be impossible.
Remember that replicators could not solve the problem of the missing circulator pump in "Devil in the Dark", yet we know that the pump must be nothing but a slightly more complex flintlock. Somebody created it at some point, using unknown technologies. But the feat could not be repeated instantaneously, even though a comparable feat could be achieved a tad more slowly in "A Private Little War". There's plenty of room for "conventional" manufacturing and acquisition technologies in the Trek universe, despite the parallel existence of amazing new technologies. Just like in the real world today.
3. The food replicator may or may not have the ability to replicate things other than food. We see this in the manufacture of flintlocks on short notice, since it is unlikely that the Enterprise carried 18th century weapons on board.
OTOH, a food replicator could
not have made a flintlock, because the barrel would not fit inside.
It's pretty clear that whatever manufacturing capabilities Kirk's TOS ship has, these are based on separate machinery in dedicated workshops. No doubt this separation is also reflected in said machinery being optimized for its job and thus at least subtly and probably grossly different from the food-producing systems, even if both happen to rely on the same scientific principles of bringing things to existence.
4. Fascinatingly enough, nobody ever addressed the question of using the transporter to replicate stuff. Obviously, cloning is possible, albeit with amusing results, so what's so wrong with using it to convert one object into another?
Cloning only happens by curious accident, which our heroes struggle to understand. Trying to make use of that is a bit like trying to power your computer with lightning strikes. And we never get any indication that the transporter could transform an object in any significant way. At best, it can take things away from the object: remove disease carriers, depower a weapon, make Kirk's clone a few retards short of a Jack Pack...
The bottom line is, Star Trek has never been a show where much-needed things can be made to appear trivially on demand. It always involves a lot of sweat, blood and tears to get stuff done, just like today. I can cook; I can build a small house; I can even pile atoms on an AFM to create a funny stick figure a few nanometers tall. It doesn't follow that I could make a pony appear out of thin air, least of all if I desperately needed one for a quick getaway.
Timo Saloniemi