There are several versions of "panspermia".
One is "aliens did it" and is the province of fruitloops and cranks.
Another, equally out there, is that life was brought to Earth on asteroids. (and how does life spontaneously form in space, eh?)
However, there is one hypothesis that is not from Wingnutia. It is a fact that certain types of organic molecules form in space, on asteroids and in gas clouds. Some amino acids, sugars, etc.
The non-fruitloop version of panspermia hypothesizes that these organic molecules, brought to earth by asteroid bombardment, "kick-started" the process of abiogenesis. The fact is that life appeared shortly after the LHB (Late Heavy Bombardment) at the end of the Hadean. In other words, it doesn't posit that life was brought to Earth by asteroids (or aliens), only that these molecules were.