The short answer is: nobody knows.
There are a great many different kinds of
bacteria, and those bacteria are more different
from each-other and from non-bacterial life that
we suspect that the common ancestor of us all was
some kind of bacterium-like organism that lived
more than three billion years ago. Nobody yet
knows how that first living cell arose from
nonliving matter. An incomplete list of hypotheses
1. Coacervates: the chemicals that make up cell
membranes naturally form into soapy bubbles in
water, and if they have the right proteins inside
they can have a sort of metabolism that is in some
2. Zeolites: zeolites are clay minerals that
can catalyze chemical reactions like enzymes can.
It is possible that the first biochemistry
happened on the surfaces of these mineral grains.
3. Non-cellular life: all life that we know
about is composed of cells, but there are
non-cellular things in nature that resemble living
things, namely viruses. Moreover, we do know that
proteins aren't the only things that can catalyze
reactions; RNA can do that, too, and RNA is the
genetic material in many viruses (HIV for
example). Viruses are not organisms in the
traditional sense - they require cellular
machinery to reproduce - but perhaps virus-like
organisms bound in proteins or other chemicals
originated before cells did?
4. Meteorites from space: it has been suggested
that life on Earth came from elsewhere in the
universe, Mars being a particularly plausible
suggestion because Mars was probably wet before
the Earth was. Of course, this just raises the
question of how life arose on Mars (or wherever).