A refinery is a facility where raw materials are converted into some valuable substance by having impurities removed. At an oil refinery, crude oil is treated and made into gasoline and other petroleum products.
Whenever a material needs to have unwanted parts removed in order to be made into a useable product, it must be refined — clarified or processed. This is done at a plant called a refinery. A sugar refinery, for example, converts sugar cane or beets into familiar white, refined crystals of sugar. Refinery comes from refine, which is rooted in the now-obsolete verb fine, "make fine."