The interstellar cloud from which the solar nebula formed was originally somewhat flat. The force of gravity pulled the material downward into a flat disk. As the nebula cooled, the gas and dust settled onto a disk. Comets formed from the jovian nebula, while asteroids did not. Asteroids formed inside the frost line, while comets formed outside.
Asteroids are much larger than comets.
Comets are much larger than asteroids. Actually, we never see asteroids in the gaps. Jupiter's gravitational tugs keep them there. A gap is located at an average orbital distance, and asteroid orbits often have large eccentricities. They are held in place by resonances with other asteroids.