Petroleum comes in several grades, anything called "sweet" is low sulfur, and "sour" is high sulfur (which is cheaper). Petroleum is a complex mixture of hydrocarbons ranging from methane with one carbon which is in effect natural gas to very high chainlength hydrocarbons used in things like asphalt.
The first step in refining is to separate these by volatility, my oil company friends would talk about their "C4 stream" for example, which was mostly butane. Gasoline is mostly C8, which is called "octane" but isn't the same thing as the octane rating. Higher octane is achieved in part by branching, straight chained hydrocarbons have very low octane (but high cetane for Diesel). So another step is to rearrange straight chains to get branched chains for octane rating. And there are additives that make higher octane, one is ethanol. Premium gas can contain more ethanol as a cheap way to increase octane, but it lowers fuel economy (and power). Tetraethyl lead was for decades the cheap way to add octane rating.
In winter, gasoline has more C7 and C6 in it for volatility, in summer, less of that, and some C9 C10. This was more important with carburetors.