It looks like there were bacteria on Earth just a few hundred million years after the planet formed a solid surface. On other hand next major steps in evolution - like eucariots and multi-cellurality took billions of years. Either early life evolution was extremely fast or life originated elsewhere and had much more time to evolve into bacteria and archea.
One panspermia hypothesis is life originated on Mars. It has a lot of iron, and iron catalysis a lot of the chemical reactions that probably made early life. Mars formed a solid surface about a billion years earlier than Earth. Also early on it had a magnetic field, that could protect a thicker athmosphere, that would allow for the existance of seas and oceans. So potentially life originated on Mars, took a billion years to evolve into bacteria/archea, which made the jorney to earth on pieces of rock, displaced by an asteroid impact (a lot of Marsian rocks fall down on Earth).