How do asteroids form?

Asteroids formed from left over materials from when our solar system formed that never formed into a planet.