You might want to tighten up a little on those "billions of years." You've only got about 4.5 billion years to work with.
According to scientific studies it took at least 2 billion years for the Earth to gain a sufficiently oxygenated atmosphere comparable to what we now have, as a result of the input of anaerobic life forms. Then because of the reduction of CO2, the Earth's atmosphere cooled a little over 2-2.5 billion years ago, coinciding when oxygen became a principle gas in the atmosphere and multicellular organisms first appeared.
Probably volcanic activity which increased CO2, brought the Earth back into a warm period but again the Earth's atmosphere cooled dramatically about 750 million years ago, bringing about what was theorised as the Snowball Earth where glaciers were believed to have almost reached the tropics. It seems volcanic activity again warmed the Earth by increasing CO2 levels and since then there has been more or less a balance between O2 and CO2 levels that has maintained a warm period during which complex lifeforms developed significantly.
We are now in a cooling period (interfered with by human activity) brought about mainly by the movement of the continents restricting water movement.
So 4.5 billion years back the Earth formed. Probably life began around 3.5 to 4 billion years ago. Oxygen became a dominant gas in the atmosphere around 2-2.5 billion years ago coinciding with the first appearance of multicellular organisms during a cooling period. Then 750 million years back, reduced CO2 led to Snowball Earth. 550 million years ago the atmosphere warmed again, followed by the blooming of more complex multi cellular creatures.
It is surely no coincidence that multi-cellular life forms started to appear and then thrived at the time when oxygen became one of the primary components of the atmosphere, and that process eventually led to us.