Thank you very much. To understand it one must first understand the Greenhouse Effect, as I already mentioned. And to understand that it is best to understand the Stefan-Boltzmann Law.
To keep it really simple, if one places an object in a vacuum and exposes it to energy that object will heat up. That is obvious. The question is how much? And the Stefan-Boltzmann Law is an attempt to explain how much an object heats up or loses heat in a vacuum. The Earth is after all just a large object in space, or a vacuum. It receives energy from the Sun. What we are concerned with is the average temperature. The Moon's temperature varies widely as it rotates since it rotates slowly and it is in a pure vacuum so its daylight side gets straight undiluted sunlight and its night side has nothing to keep the energy in.
Before I get too far here is a link to the Stefan-Boltzmann Law:
Stefan–Boltzmann law - Wikipedia
In its most basic form it deals with an ideal black body. An object that absorbs all energy that hits it and is the same temperature everywhere. Physics quite often simplifies problems by dealing with the ideal first.
The energy hitting the Earth is easy to calculate. I am not going to copy and past, but it is in the linked article. That starts here:
Stefan–Boltzmann law - Wikipedia
If the Earth was a perfect black body its temperature would be about 6 C. But the Earth is not a perfect black body. One can adjust the Stefan Boltzmann Law to take that into account by adding a factor for the albedo, the amount of energy reflected back out to space without being absorbed. Using that the average temperature of the Earth is -18 C. Most people are quite aware that the Earth is not that cold. Right now it is about 14.6 C or 32 degrees Celsius warmer than that predicted by the Stefan-Boltzmann Law. Clearly something is wrong.
Any questions before we go on?