Gasoline was once a largely unwanted byproduct of refining crude oil, produced while companies focused on making kerosene for lamps in the 19th century.