Scientists hypothesize that the universe came into existence about 15 billion years ago with a colossal explosion often referred to as the big bang. The gases and dust from that explosion produced the earliest generation of stars, and over a period of billions of years, the stars exploded, and their debris formed other stars and planets. The solar system was presumably formed in this way 4 to 5 billion years ago. During the next billion years, the molten earth cooled, forming a hardened, outer crust. About 3.5 billion years ago, living things came into being.
About 3.8 billion years ago, earth's atmosphere consisted of such elements as nitrogen, hydrogen, sodium, sulfur, and carbon. Some of these elements combined to form hydrogen sulfide, methane, water, and ammonia. Water vapor in this mist probably caused millions of years of torrential rains, during which the oceans formed. Gas and water from the earth's core came to the surface through volcanoes. Ultraviolet radiation bathed the earth, and the elements and compounds interacted with one another to form complex molecules.
In 1953, Stanley Miller and Howard Urey performed a classic experiment in which they circulated methane, ammonia, water vapor, and hydrogen gas in a closed environment and passed electric sparks through it. After several days, they discovered that complex compounds of carbon had formed in the mixture. Their experiments indicated that in the primitive earth atmosphere, complex organic molecules could form, including amino acids, carbohydrates, and nucleic acids. The theory they expressed is the primordial soup theory.
Recent theories about the origin of organic molecules suggest that these molecules may have formed in hydrothermal vents deep in the oceans, where hot gases and elements emerge from cracks in the earth's crust. Living organisms have been found near these vents, lending credence to the theory.