What are the the sources of the stored and activation energies in gasoline?

It starts with sunlight then plants but what is next?

death of plants, centuries in the ground, conversion to oil, drilling, fractionation should get you started.