A secondary atmosphere is a planetary atmosphere that did not form directly via accretion during the formation of the planetary system. It is characteristic of terrestrial planets such as the four planets of the Inner Solar System, i.e. Mercury, Venus, Earth (specifically Archean Earth) and Mars, as these planets typically are not massive enough for gravity to long-lastingly retain the compositions of their initial primary atmospheres.
When a protoplanet forms from coalescence of planetesimals, it begins to achieve sufficient mass to also accrete volatile gases from the protoplanetary disk, which envelope the planetary surface forming an atmosphere with primordial ("protosolar") compositions identical/similar to the original circumstellar disk, i.e. the primary atmosphere. Due to ongoing atmospheric escape, outgassing from internal volcanic activities, chemical reactions among the volatiles, and/or meteoric introduction of foreign volatiles from impact events with comets and asteroids, the primary atmosphere will experience gradual alterations to its compositions over time, and a secondary atmosphere forms when the accumulated alterations are significant enough.