Sunlight warms the ground; the warm ground glows back in invisible infrared. Greenhouse gases let the sunlight in but absorb that outgoing infrared and radiate some of it back down — keeping the surface warmer than it would otherwise be. Watch the energy flow.
Yellow shortwave sunlight passes through the atmosphere and heats the surface. The surface emits red infrared; greenhouse-gas molecules absorb some and re-emit it in all directions — including back down. The rest escapes to space.
Slide the greenhouse-gas amount. With more gas, a larger share of outgoing infrared is intercepted and returned, so the surface settles at a higher temperature. (Schematic — the bars show the balance and the dial shows relative warming.)