But this is not, in canon, how they work. It's been explained that the replicator system is basically a transporter system that's been reconfigured to take matter in one form, dematerialize it, and rearrange it at the atomic level into whatever form the end-user wants. The replicator system draws the matter from a storage unit called the 'matter storage tank,' which is a fancy word for 'high-end garbage disposal.' It's a holding unit where all the waste material aboard a starship, both biological and technological, ends up, and is kept, until the replicators need the raw matter they're made of. So, rather than having to haul around pre-made space tofu for conversion into imitation turkey, the replicator system scoops up three parts' worth of burnt-out power couplings, two parts' worth of discarded Bolian soufflé, and one parts' worth of explosive Klingon diarrhea, does some atomic rearranging, and pops out a semi-convincing, nutritionally-perfect version of Grandma's Christmas turkey for your consumption.
Charming, isn't it?