Refineries are buildings that refine raw resources/ore or less-refined materials into more-refined materials. Refineries take one or more products as inputs, and produce one or more products as outputs, in amounts and on timelines determined by whichever industrial process is selected. Refineries must be pointed to appropriate destination storage facilities like Warehouses or ships, to receive the refined materials.
If you happen to see Old Rutherford at the bar and buy him a drink, he’ll tell you the story of why first-, second-, and third-gen refineries are called “eggshells”, “eggs”, and “chickens” in miners’ slang. Just be careful; the story is not as good as Rutherford’s taste in expensive drinks. But if you have the SWAY to spare, you might as well treat him.