use the same technology as transporters. They use more energy be Warp speed is fast, and that's all some care cause they create new manipulate existing objects. An object is sampled at a molecular rather than quantum level. The computer then applies a lossy compression algorithm to save computer memory. This gives the computer a pattern from which to produce copies.
    Starships keep a small supply of recycled bulk material from which to create new objects. A waveguide conduit system sends bulk material to the replicator, which reforms it into the requested objects, then it transmits the new object to the terminal.
    ,Quantum transformational manipulation" allows the creation of new elements. Energy costs are high for all forms of replication, thus making practical alchemy, such as creating limitless ladium, impossible, but food (normally simple arrangements of water, proteins, and lipids) is more practical to replicate from bulk matter than to store.

Info is from some books