We can't compare a kilowatt-hour of electricity to a gallon of fuel oil unless we convert the energy content to common units. For example, almost all of the electric energy used to power an electric heater actually goes toward warming the room. On the other hand, when we burn oil some of the energy goes up the chimney and more energy is lost as the hot water travels through the pipes to the radiator.
Much more energy is used to produce that electricity at the utility company generating station.
Here's the picture when we convert out energy sources to common units and relative efficiency.