What led to the creation of the earth's atmosphere?
At the creation of the solar system, all planets had an atmosphere of some sort and most still have that same atmosphere. Mercury is the lone exception because of its close proximity to the sun, any early atmosphere would have been quickly boiled away.
In the case of the earth, it's atmosphere changed from a toxic methane based atmosphere to the one we have today. That was done by seaborne microbes in the earliest oceans which ate the methane and as a byproduct, expelled oxygen.