Early life didn't just pop into existence. It was a process that took place over the course of millions of years. At first, small, inorganic molecules in a water environment combined into larger, more complex organic molecules as a result of lightning.
These molecules became encapsulated in a membrane over time, and eventually, these membrane molecules gained the ability to replicate themselves. They were the earliest forms of life, called prokaryotes (shown below), and they formed about 3.8 billion years ago.
Over time, prokaryotes split into varying types, which included bacteria. They developed the capacity to metabolize things, including each other. One of these types of metabolism was photosynthesis. Photosynthetic metabolism led to free oxygen production.
Some prokaryotes began to form symbiotic relationships with each other about 1.8 billion years ago. One would protect the other, while the other focused on energy production. This relationship led to eukaryotes. About 600 million years ago, eukaryotes led to multi-celled organisms, where different cell types specialized in different tasks for the functioning of the whole. This led to fungi, algae, plants, and animals.
Eventually, water subsided from certain parts of the planet, which allowed enough dry land for plants to adapt to a terrestrial environment. As more terrestrial plants evolved, they provided a potential food source for animals to consume on land.
Plants and animals faced other challenges to adapting to land, such as:
Organisms also had to adapt the process of reproduction to life on land, because all such processes had previously relied on an aquatic environment. It wasn't until enough oxygen collected in the atmosphere and then reacted with solar radiation to form a thick enough ozone layer that protected organisms from radiation, that land adaptation began in earnest.
Source: Adapted from Sophia instructor Jensen Morgan, PROKARYOTES PD HTTP://BIT.LY/1BDCO9O