Here's why:
* Star Formation: Planets form within protoplanetary disks around young stars. These disks are made of gas and dust that eventually coalesce into planets.
* Different Star Ages: Stars form at different times in different parts of the galaxy. This means the protoplanetary disks around them also form at different times.
* Planet Formation Timelines: The process of planet formation itself takes a long time, potentially millions or even billions of years. Some planets form quickly, while others take much longer.
Therefore, the planets in our solar system and elsewhere in the galaxy formed over a long period of time, with some planets being significantly older than others.
There are also ongoing theories about planet formation that suggest planets can form throughout the lifetime of a star, not just in the early stages. This means that planets could potentially form in a star system even billions of years after the star itself formed.