Why do gas planets have rings?

The gas planets have rings because of the gravitational pull and the outward force of the gases causing any meteors to be trapped in the ring.