When the sun shines on a greenhouse, the light is absorbed and divided over your greenhouse as heat energy. The sunlight is being absorbed by the material of the greenhouse, the soil and the plants and is being transformed into heat energy. The materials that are being heated will retain their heat and transmit a long wave heat radiation which is how the temperature rises in a greenhouse.
While this explanation might be quite technical, it’s no different to how a room will heat up when the sun is shining on it. Because the greenhouse is made entirely out of glass or transparent polycarbonate, the effect inside will be much larger than in a room with one or two windows. The heat and light will give your vegetables and flowers the energy they need to grow.