When the sunlight reaches earth's surface, some of it is absorbed and warms the earth. Most of it is radiated back to the atmosphere at a longer wavelength than the sunlight.
Some of these longer wavelengths are absorbed by the greenhouse gases in the atmosphere and reflect them back to the earth before they are lost to space.
The absorption of this longwave radiant energy warms the atmosphere. The reflecting back of heat energy by the atmosphere is called 'Greenhouse effect'.
The increase in man-made emissions causes an increase in the atmosphere of greenhouse gas concentrations like water vapour, carbon-dioxide, methane, ozone contributing to the greenhouse effect.
The largest contributing sources is burning of fossil fuel like oil, gas, petrol, kerosene etc leading to the emission of carbon-dioxide.
Green house effect can happen even without any plants being grown in green house.
This phenomenon was extrapolated to earth's atmosphere. The radiation received by earth but not able to be reflected can become 'Green house' effect.
That is short waves of infrared and rear infrared rays are trapped in the layer immediately above the earth's surface - just like a green house.