How come some planets have moons and some do not?

Most planets form moons from impacts with large objects or by grabbing nearby asteroids, says geophysicist Ana-Catalina Plesa. At the Institute of Planetary Research in Berlin, Germany, she studies the insides of rocky planets and icy moons. Our own moon may have formed from debris ejected by a massive collision billions of years ago. But whether a planet can have moons depends on its position in the solar system, says Plesa. Near the sun, gravity is too strong for moons to form. So planets like Mercury and Venus can’t gather moons. Farther out, the sun’s gravity plays less of a role. And gas giants like Jupiter and Saturn are so big that their gravity is much stronger than that of the
smaller inner planets. This makes them more likely to hold onto debris from impacts and pull passing asteroids into their orbits.