Some planets have more moons than others because they are larger and made of gas rather than solids. Large gaseous planets such as Mercury, Earth, Venus and Mars have the greatest number of moons in their orbital fields because of their size, which facilitates gravitational pull, and their gaseous composition.
The number of moons that planets have varies depending on each planet's size and physical composition. Larger planets have stronger and farther-reaching gravitational fields, which act as giant magnets to keep other celestial bodies, such as moons, in close orbit. When large planets capture moons in their orbital fields, they have a greater potential, or likelihood, of keeping those moons in orbit because of their extensive gravitational reach. That reach also gives them greater control, meaning they can occupy a greater space and may hold larger volumes of mass in their surrounding atmospheres. In addition to size, geography and physical composition of the planet and its moons (or lack of) factor into the equation too. Areas of planets with stronger gravitational pull (including oceans, large water bodies and tall structures such as mountains and volcanoes) help to reel in and keep moons in orbit. Just as planets vary in weight and size, moons do too. Like planets, moons comprised of gases are more likely to stay in orbit around planets in the solar system.