Molecules of greenhouse gases have energy levels and their energy level differences correspond to infrared photon energy → molecules are good at absorbing and re-emits back to Earth’s surface
Without greenhouse gases, less infrared is absorbed and trapped, so less infrared is re-radiated to Earth, hence the Earth’s surface is less heated up and its surface temperature decreases