When a planet is forming in a protoplanetary disk, it needs the gas in the disk to fall into its Bondi sphere in order for the planet to be able to accrete an atmosphere. For a massive enough planet, the initial accreted gas can quickly fill up the Bondi sphere. At this point, the atmosphere must cool and contract (through the Kelvin–Helmholtz mechanism) for the planet to be able to accrete more of an atmosphere.