Refining oil starts with distillation
Have you ever wondered why you can't just use raw crude oil in a diesel engine or why your car won't run by filling the tank with kerosene or engine oil? If these things could be done, then in large part, we would not need oil refineries. Rather we could just filter the dirt out of the raw crude oil and burn that for our various energy needs. Largely, the problem is that crude oil is a mixture of very many different kinds of hydrocarbons. A hydrocarbon is a molecule made of only carbon atoms and hydrogen atoms. Typically, a hydrocarbon is a chain of connected carbon atoms to which hydrogen atoms are then attached.
Some hydrocarbons are a bit more complicated in structure but they are all composed of just carbon and hydrogen. This means that when they burn, the end product (if combustion was 100% complete) would be pure water and carbon dioxide. Rarely does combustion take place at 100% but we try to get as close as we can. This leaves behind some remnant of noxious smoke along with some portion of soot. Engines, furnaces and reactors are designed to be as efficient as possible to get as much energy out of the burning hydrocarbons as possible and modern designs require fuel molecules to all be a similar size. Engineers and scientists are continually trying to find better ways to maximize the energy efficiency of chemical reactors including engines and boiler designs.
Each distinct hydrocarbon molecule has both a different boiling point and flammability temperature. Those molecules which are smaller will have the lowest boiling and ignition temperatures. Likewise larger hydrocarbon molecules will require higher temperatures to both boil and burn. This is because the larger molecules have more surface area and the adhesion forces between molecules holding them to each other increases with each atom that can touch another. Long chain molecules have more atoms to attach to nearby molecules making them want to stick to each other more than that for smaller molecules. In this sense, molecules which are twice as long have twice the binding energy when they can stick together.
This means that if you were to take crude oil and try to burn it, you first have to try to heat it to its ignition temperature which would only evaporate the smaller molecules first. In the process of heating the oil, those smaller molecules would not only be the first to evaporate from the liquid but they would also be the first to ignite. This includes the smaller hydrocarbons such as methane, propane and butane. When these ignite, the larger molecules of oil in the fuel are not burned and remain to either be burned later or to remain as an undesirable residue (assuming you want the full fuel spray present to ignite in the reaction chamber). By only having a single narrow size range of fuel molecules in a burner, they will all evaporate and ignite at the same temperatures allowing for a high efficiency combustion process.
Most of the molecular separation at an industrial oil refinery uses a distillation process through heating and condensing the vapors produced from boiling the oil. This allows a gross separation of molecular size ranges. This separation is sufficient for some applications although others require further processing. Future engine designs will likely allow a larger size distribution of fuel molecules to be burned efficiently but we don't have that yet. Until then, oil refineries will be required for us to obtain the highest efficient use of our fossil fuel resources we can currently attain.