Hydrocarbons are formed when the iron in olivine (in Earth's case magmatic peridotite) combines with mantle hydrogen (or sea water) and lithospheric carbon. For alkanes higher than methane extreme pressures are required.
The evolution of multicomponent systems at high pressures: VI. The thermodynamic stability of the hydrogen–carbon system: The genesis of hydrocarbons and the origin of petroleum.
The high-pressure genesis of petroleum hydrocarbons has been demonstrated using only the reagents solid iron oxide, FeO, and marble, CaCO3, 99.9% pure and wet with triple-distilled water.