The moons of the solar system formed in different ways depending on the planets around which they orbit. Each moon has a specific history and origin that depends on many factors, including the composition of the planet, its environment, gravitational interactions, and events that occurred during the formation of the solar system.