It's kind of a mind boggingly huge billiard game.
With a bit of luck, life was somewhere around the initial impact, a couple bits of life survive blast energy, cold of space, radiation exposure, passage of time, atmosphere entry, and impact, and finally feel cozy enough on the new rock to replicate.
Now, the metagame is to assign numbers to all of that, and compare that to the odds of molecules assembling themselves into spawning life locally by itself. Also the latter must have happened somewhere first anyway, the question mostly being which of it is it for Earth.
This seems incredibly far fetched but the time scales are galactic, and so it kind of looks like it happened a few times over but we're not quite sure yet: