The solar system is thought to have formed about 4.6 billion years ago from a giant molecular cloud. This cloud was made up of gas and dust, and it was triggered to collapse by some event such as a nearby supernova. As the cloud collapsed, it began to spin, and the material in the center became very hot and dense. This formed the sun.
The remaining material in the cloud formed a disk around the sun. This disk was made up of gas and dust, and it was from this disk that the planets, moons, and other objects in the solar system formed.
The process of planet formation is thought to have occurred in several stages. First, the dust in the disk began to collide and stick together, forming small particles called planetesimals. These planetesimals then collided and merged with each other, growing in size until they formed the planets.
The Ryugu asteroid is thought to be a remnant from the early stages of planet formation. It is made up of a mixture of rock and ice, and it has a very irregular shape. This suggests that it has not been significantly altered since it was formed, and it may provide valuable clues about the conditions in the early solar system.
The Ryugu asteroid was visited by the Japanese Hayabusa2 spacecraft in 2018-2019. This spacecraft collected samples from the asteroid and returned them to Earth. These samples are now being studied by scientists, and they are expected to provide new insights into the formation of the solar system.