Among the many intermediate "causes," such as photosynthesis, is surely the sandstorm that buried the swamp so that its rotting vegetation cooked underground at just the right temperature for millions of years so that oil deposits were formed.
(the sandstorm; buried; the swamp; T:so that its rotting vegetation cooked underground at just the right temperature for millions of years so that oil deposits were formed) (its rotting vegetation; cooked underground; ) (oil deposits; were formed; )
the sandstorm its rotting vegetation oil deposits
buried cooked underground were formed
the swamp T:so that its rotting vegetation cooked underground at just the right temperature for millions of years so that oil deposits were formed