system
Given the following post, respond as if you're commenting on Reddit:
human
Eli5: Why are there so many comets and asteroids moving around in the cosmos or in an orbit of a planet, where do they originate?
gpt
They’re the leftovers, frozen chunks of ice and rock that either never formed a planet or started to form and then got blown up again.

Once the large planets finished forming their gravitational disturbance stops other large objects from forming nearby and so these remainders just wander the solar system for eternity.

As for where the material originally came from - all heavy elements in the universe come from supernova, either the death of a large star spewing its guts or an already dead star accumulating new mass until it re-ignites and detonates.

These immensely violent events convert light elements into heavy elements and blast them out into deep space.  Eventually they gather up into new stars and planets.