... How is it that the molecules release a lot of energy, but it does not take a lot of energy to produce them? ... Do we even know what oil is made of?
In reverses order:
As oil is highly transformed, answer is not known with 100% certainty, but nearly so. In my post to oilisM with two questions, the second suggested that for millions of years all the surface waters were covered with a scum of single cell life forms which I called "Algaes" as they captured and stored solar energy in their bodies. AND that there were not yet any primitive worms, fish etc to eat them so they died of old age (couple of months probably) feel to the bottom and a few were not oxidized as the bottom below them was deep, cold (about 5 degrees C, like in your refrigerator) and completely oxygen free. You need to collect a lot of sunshine and store it for a very long time - >2/3 of world covered by algae scum is about the only way.
OilisM, as I guessed he would in that post, saw where I was going and is refusing to answer, so I will just put my next question here:
(3) How many kilometers thick do you think the layers of dead un-oxidized organic material became in a million years if the sea floor it was resting on was slowing sinking so that even the top of the layer was still in cold, oxygen-free water?
AND
(4) As they are not down there still and worms and fish etc need oxygen, where are they, if not as recently Brazil find of oil below 6000 meters of a salt layer they were buried by mud or salt etc.?
In the case of PetroBras's new discoveries, probably the sinking of the ocean floor stopped, surely before all of their mass (slowly turned to oil) got so deep to be decomposed into CH4 and carbonate rocks (as it is still oil). That section may not only have stopped sinking but rose again and was "pinched off" and form by evaporation in the tropical sun a great salt flat, which sank again to its current location, with top about 2500m below the current sea surface. There are other ways the salt deposits can form. - I am not suggesting this must be how it happened.
For example, the Med Sea is saltier than the Atlantic ocean. It would dry up if the Strait of Gibraltar were closed (in fact it has dried up relatively recently - probably during the last ice age when the current continuous inflow from the Atlantic was not possible as with so much water was stored on land that the Atlantic was too low to flow over the into the Med Sea Valley.)
There are salt deposits under the mud on the bottom of the Med Sea also. There are flooded cities under it too. What happen in this case is surely that as the ice melted and the Atlantic rose there came a month when the Atlantic could flow, at high tides, into the Great Med Valley, which was a salt filled valley. This inflow was self accelerating. - I.e. the erosion cut channels that speeded the inflow. (US and Soviet submarines still uses these erosion cut channels to slip in and out of the Med Sea undetected.) Also although today there is still a net inflow from the Atlantic into the Med Sea. (Evaporation of the Med Sea is greater than river inflow.) There is also an out flow of the heaver more-salty Med Water into the Atlantic in these old deep erosion channels. This creates additional sonar cover for the subs in the Atlantic near the Med Sea via a natural version of the "Taylor Instability." I.e. the dense saltier water flowing from the Med Sea into the Atlantic falls down a little (even just a meter) and contacts colder Atlantic water and becomes more dense as it cools, so it falls even faster forming a "falling finger". - That is the Taylor instability. So just off the Straits of Gibraltar you have hundreds of "falling fingers" of higher salt content water. Sonar here is impossible as each finger scatters and reflects much more sound waves than a small submarine does. Both the US and the USSR could and did move their subs in and out of the Atlantic with little fear the other could detect them.
Also the sudden flooding of some of these cities is probably the real basis for both the "Noah Flood" and the "Lost Atlantis" legends. It must have been terrible. Thousand of people in cities, which were on slightly higher ground, were surounded by salt water in a few weeks. I.e. they were suddenly living on an island. As the salt water continued to rise and submerged their island in a few months most drowned. Noah was probably one of the few rich enough to buy a big boat get his cows etc. out to Egypt or some other not flooding region.
Sorry about that long detour, but I love to teach. Back to the point:
You get energy from burning oil as the H2O and CO2 have the H and C more tightly bound chemically than it was in the C-H bond of oil. Let make up (too lazy to look up) some energy levels to illustrate numerically the whole process (Dead algae to automobile exhaust):
Although not exactly true, let’s say zero energy level is in the H2O and CO2 molecules and the octane, C8H10 is at level 10 above zero, and that the DA (dead algae) molecule are at energy level 6.
So here it the process: DA cannot get up to C8H10 without some energy boost. It gets it when DA gets deeper into the Earth from the thermal energy; but only very rarely when two DAs collide with exceptional large relative speeds. {tiny fraction 10^(-20) of all the collisions, my guess} I.e. DA1 + DA2 ---> C8H10 slowly. (of course oil is many differ hydrocarbons so probably only a few of the (DA1+DA2) united molecules are C8H10, but I am only trying to illustrate the idea, not be accurate.
So now having absorbed and stored some thermal energy the mess of DA molecules is the mess of molecules we call oil (and that exact mix will be very varied as it depends strongly on the temperature it has experienced and some on the exact spectrum of DA molecules that the Algae had.
If oil were a simple union of hydrogen and carbon a-biotically formed as OilisM suggest, then oil would be nearly the same everywhere and only contain a few dozen, at most, different molecules. Inorganic chemical reactions do not result in thousands of different reaction products - only organic reaction produce the sort of molecular mess that that is oil.
Now when the C8H10 is united chemically with O2 (i.e. burned) you get 10(8 + 10) or 180 of my units of energy as C8H10 becomes 8 CO2 & 10 H2O molecules. That should be clear, but if you can stand my long rambling :bugeye: (possibly with another detour
) ask for more clarifications