The Earth absorbs radiation from the Sun, mostly visible light, and emits its own radiation into space, mostly infrared. Over many years the average temperature stays roughly steady when the power absorbed equals the power radiated. If anything upsets that balance, the temperature changes until a new balance is reached.
Some factors reduce the radiation absorbed. Clouds, ice and snow reflect a large fraction of sunlight back into space, and so do volcanic ash and other particles in the atmosphere. More reflection means less power is absorbed, so the Earth cools. When ice melts, the dark sea or land beneath absorbs more sunlight, which warms the Earth further.
Other factors affect the radiation emitted. Greenhouse gases such as carbon dioxide, methane and water vapour absorb some of the infrared leaving the surface and re-emit it in all directions, including back down. Less energy escapes to space, so the Earth radiates less power than it absorbs and warms. As it warms it radiates more, until a new balance is reached at a higher temperature. Adding more greenhouse gases therefore raises the average temperature.