The origin of complex hydrocarbons and early life is inextricably mixed up with the origin of the biogenic elements, which leads straight into the origin of the solar system and galaxy, possibly even the universe itself. This, along with the complex and traumatic geology of Earth's early history may give clues as to how the hydrocarbons where able to be synthesised in the first place and how they where subsequently concentrated to a level where the process of replication and the first seeds of life could occur.
In the beginning, to coin an old phrase, there was a solar system in its infancy; a swirling cloud of dust which due to physics had become a great disk of dust, and not just dust but larger rocky fragments the size of pebbles, which grew larger by accreting to each other. This dust cloud is spinning around a young star, our sun shining at about a fourth of its current brightness.
However this was not the beginning this; young solar disk is comprised of material derived from other stars that had been born, lived their lives and then died, either in dramatic supernovae, of which there are several types; each producing different types of elements by nucleosynthesis, or by their remnants simply scattered by interstellar winds leaving behind brown dwarfs. The debris from these long dead stars accumulated into a giant dust cloud, which under its own pressure began to collapse leading to the coalescence of a young star, in this case the sun, at the centre.
Once the body of coalesced material at the centre gained enough mass it began to contract whilst still accumulating more material from the surrounding cloud. Once the body had gathered enough mass and had contracted to a significant density nuclear fusion began to take place, radiating light and also resulting nucleosynthesis of He from H as had happened in the earlier stars who had provided the material for the gas clouds. The lighter elements such as H and He to Fe come from the stars that just petter out, and it would appear that these are the most common i.e. main sequence stars where are the heavier elements come from the supernovae explosions.
This means that there would be a higher abundance of the lighter elements within the dust cloud, and these elements mainly correspond with those used by life on the Earth. However, it is not that simple as many of these lighter elements and their resulting compounds including simple hydrocarbons such as methane CH4 would have been driven away from the centre portion of the solar system where our planet lies. This is due to the temperature gradient which occurs throughout the dust cloud, from its boiling hellish interior, where it is hot enough to melt most types of rock, to the frozen periphery, where temperatures near absolute zero. Due to this huge temperature gradient and the fact that lighter particles need less energy to be transported, a sort of settling out effect occurs with the heavier particles being deposited first nearest to the centre of the would be solar system and the lighter ones being transported the furthest.
These lighter partials which constitute the building blocks for the complex hydrocarbons i.e. Ammonia, CH4 and H2O, at the edge of the Oort cloud that surrounded the early solar systems these froze into lumps of dirty ice which still orbit the sun today in eccentric highly elliptical orbits, we call them comets! Is it possible that these acted as a crèche to protect these fundamentals to life whilst at the centre region of the solar system was experiencing the formation of the disc, which we witnessed at the beginning of this section. Large lumps attract smaller lumps which then stick to them causing accretion to occur.
Any complex hydrocarbon that would have formed at this point due to the high energy of the system would have been obliterated by this same energy. The accretionary lumps became protoplanets called planetesimals with approximately circular orbits. The gravitational pull of these objects increases as their size increases, resulting in higher velocity impacts. Thus the planets where born, this took a mere 10 to 20 million years for the rocky inner planets including the Earth to form. (Wills and Bada 2001).
This, however, was not an environment that was exactly conducive to the formation of hydrocarbons, though it was to become a very proficient one later on. Instead lets turn our heads back to the outermost regions of the solar system where some seemingly uninteresting chunks of ice lurk.(this is covered in UNDER THE GROUND, UNDER THE SEA OR FROM ABOVE.)
At some point during the Earth's early life a Mars-sized object collided with it stripping part of its mantle as well as mixing in chemical components of its own. This impact would have destroyed any innate hydrocarbons present meaning that their main source directly after this had occurred would have been from other less disastrous impacts and volcanic activity.
However as a result of this cataclysm for the young Earth, the Moon was born. It would have been much closer to the Earth during the Achaean than it is at the present day. Once the seas recondensed onto the surface enormous tides would have been evident especially as the new land that would have just started to appear would have been low lying.
The Earth's atmosphere at this point would have been a turmoil of smog and lightning with a runaway greenhouse effect. It would also have been reducing, as all the O2 we currently breathe is a product of biological processes as are many other compounds we take for granted!
Tides, storms, volcanism, and fast rates of erosion putting mineral salts into a warm sea with organic molecules raining on it from above would have lead ultimately to the production of life and complex hydrocarbons. In which order this occurred is highly debatable and depends on your definition of life.