Answer:
Eventually the IR photons escape into space, but some make several round trips between the ground and the atmosphere before they depart. Along the way, a lot of energy is transferred to the ground and the atmosphere. That energy becomes heat which warms Earth's surface and its atmosphere.