Stars, planets, and asteroids organize themselves in the most simple way—their velocity and gravitation balance with each other, which allow them to do periodic movement around the stars. They find their position and orbit in the whole system only according to their own velocity and mass. The gravitation fields of the sun and planets in the solar system can be highly complex when each planets’ gravitation field overlaps and interact with the others’, this results in some exclusive celestial orbits. These asteroid orbits are in shapes of waterdrop, horseshoe, and triangle, which seem arbitrary but are simply the results of the negotiation among layers of gravitation fields.


https://solarsystem.nasa.gov/resources/754/what-is-a-lagrange-point/


https://arstechnica.com/science/2011/07/astronomers-find-earths-first-trojan-asteroid/
Jupiter’s Trojan asteroids’ waterdrop orbit


https://en.wikipedia.org/wiki/(419624)_2010_SO16#:~:text=(419624)%202010%20SO16%20is,WISE)%20on%2017%20September%202010.Asteroid

2010SO16’s horseshoe orbit (the three diagrams describe the same movement but with different reference object)


https://en.wikipedia.org/wiki/Hilda_asteroid

Hilda asteroid’s triangle orbit