If the Earth had no atmosphere, its average surface temperature would be very low of around -18ò¾ rather than the about 14.5ò¾ found today. The difference in temperature is due to a suite of gases called greenhouse gases which affect the overall energy balance of the Earth's system by absorbing infra-red radiation.
The heat content at the surface of the earth is mainly derived from the sun. When solar radiation (visible light) reached the earth, it heats up the earth. The surface temperature of the sun is about 6000ò¾ but the surface temperature of the earth is only about 14.5ò¾. In spite of the large temperature difference, the earth also emits radiation. As the surface temperature of the earth is lower, the radiation emitted has a longer wave length (infra-red) which is not visible to the eye. Nevertheless, it is still capable of scattering heat back to the outer space which in term cools the earth.
If the heating and cooling of the earth is comparable, the long-term mean temperature of the earth will remain more or less unchanged.

Condition for no greenhouse gas in the atmosphere
The greenhouse gases in the air, such as carbon dioxide, will hinder the emission of heat from the earth to outer space. The greenhouse gases absorb part of the infra-red radiation emitted from the earth and then re-emitted in all directions also in the form of infra-red radiation. Consequently, part of the heat will go into the outer space but part of it will return to the earth. This is what is known as the greenhouse effect.

Schematic diagram illustrating the Greenhouse Effect
Increase of greenhouse gases concentration causes a reduction in outgoing infrared radiation, thus the Earth's climate must change somehow to restore the balance between incoming and outgoing radiation. This lead to global warming of the Earth's surface and the lower atmosphere. A small rise in temperature will induce many other changes, for example, cloud cover and wind patterns. Some of these changes may act to enhance the warming (positive feedbacks), others to counteract it (negative feedbacks).