Carbon is not a form of energy. Carbon is an element on the periodic table.
Hydrocarbons contain energy that can be released. In the presence of oxygen, the hydrocarbon breaks apart, releases heat, and the hydrogen and carbon combine with the oxygen.
So, very simplified, the hydrocarbon (C8H18 for example) combines with the oxygen (O2), gives off heat, and forms CO2 and H2O (also known as carbon dioxide and water). The energy is contained in the molecular bonds, that when broken, release heat.
Of course, all heat is, is the vibration rate of the molecules. So really all that's happening is they vibrate faster after they react. When they vibrate faster, they take up more space, pressure goes up, and the piston goes down. Simple really.