One factor is the potential to reflect back or absorb infrared from earth's surface and the other is how long they can linger in the atmosphere. Greenhouse gases work by blocking the escape/ absorbing of infrared light that bounces back from earth surfaces hence making the earth's atmosphere warmer.