According to one of the hypotheses, the Sun and the planets were formed about 4.6 billion years ago from an extended gas and dust (protoplanetary) cloud that had the shape of a disk. It consisted of hydrogen, helium, solid dust particles, etc. The collision of atoms, molecules and dust particles under the action of gravitational forces and the exchange of energy between them led to the heating of the cloud. As a result of the interaction of solar radiation with the matter of the protoplanetary cloud, light chemical elements (hydrogen, helium) were far from the Sun (in the area where the giant planets are now). At the same time, only heavy chemical elements remained in the central part of the cloud, from which the terrestrial planets were subsequently formed. Asteroids were formed as a result of the powerful gravitational influence of Jupiter, which took a significant part of the matter from the zone of possible formation of another planet. There is a hypothesis according to which most comets originated beyond the orbit of Pluto, where there are particles of ice, methane, solid carbon dioxide mixed with dust from refractory substances – the remnants of the material from which giant planets were formed.
Note that the concept of the evolution of the solar system has not yet acquired the character of a finished theory.
Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.