The temperature gradient in each layer is determined by the heat source of the layer. Most of the important processes of the atmosphere take place in the lowest two layers: the troposphere and the stratosphere.