A replicator is a device that transforms raw materials into finished products by reorganizing matter to fit a specified pattern. Replicators began to be common appliances among the major Star Trek civilizations in the 24th century.
Replicators use technology similar to transporters, but they do not have the same resolution. Consequently, replicated objects have "single-bit errors" that make them distinguishable from the object used to make the pattern. These errors are predictable enough to even identify the make of the transporter that replicated an item. Furthermore, the lack of resolution makes it impossible to replicate living creatures, and many non-living materials are also too complex to replicate.
The Economics Argument
Trekkies often argue that replicators radically alter the economics of the future, creating a society in which anyone can have anything they want, thereby justifying the moneyless society of the Federation.
The argument is absurd because replicators do not create products from nothing: they require power, patterns, feedstock (raw materials), and maintenance. There are many products they simply can't produce, and many of the products they can make are considered inferior to similar products made by other means (which explains things like the massive popularity of Joseph Sisko's creole restaurant on Earth). The rationing of replicator usage in Star Trek: Voyager and the use of MRE-style stored meals instead of replicated meals on Defiant-class starships also show that replicators are actually less efficient than other manufacturing methods (drastically less, if the deplorably inefficient cooking methods of Neelix are still an improvement).
Consequently, replicators do not remove the supply and demand considerations of an economy; they just change the value and availability of certain commodities. This assessment is confirmed by the Ferengi economy, which continues to be a thriving capitalist economy despite the widespread use of replicators by the Ferengi.
Trekkies occasionally argue that replicators can create matter from energy, even though evidence from the show repeatedly refutes this claim.
During the Dominion War, the Federation deployed a field of mines around the Bajoran Wormhole. These mines used replicator technology to replace mines lost due to contact with passing starships or anti-mine measures employed by the enemy. The mines shared a common pool of feedstock, sharing material in their storage systems with other mines to replace lost units. The range of the replication system isn't clear. Clearly the mines must not have employed any materials known to be impossible to replicate, nor could any of the components be too complex for replicator resolution (which cannot accurately produce some microscopic structures). Since the mines were cloaked, the cloaking technology must not have required any unreplicatable components. Since replicators cannot produce anti-matter, they must have used some other reactant(s) in their warheads that could be synthesized from trace elements floating in space around the minefield. Presumably the mines could also make use of materials left by destroyed vessels or left over mine debris.