Why do some planets have rings around them and the rest do not?
If an orbiting object approaches a planet then it may be torn apart by the
tidal force of the planet. The exact distance at which this happens depends
on the composition of the orbiting object. This object could be a moon or a
passing comet or asteroid. A ring is formed by the debris of such objects.
So the planet has to be lucky enough to get an object within the correct
range and at not too oblique an incidence.