An oil refinery is an industrial process plant where crude oil is processed and refined into useful petroleum products.
Raw oil or unprocessed ("crude") oil is not very useful in the form it comes in out of the ground.
Oil needs to be separated into parts and refined before use in fuels and lubricants, and before some of the byproducts could be used in petrochemical processes to form materials such as plastics, and foams.
Petroleum fossil fuels are used in ship, automobile and aircraft engines.
These different hydrocarbons have different boiling points, which means they can be separated by distillation.
Since the lighter liquid elements are in great demand for use in internal combustion engines, a modern refinery will convert heavy hydrocarbons and lighter gaseous elements into these higher value products using complex and energy intensive processes.