@plethora, we don’t know for sure, but we have some pretty good ideas. Basically, there are three broad stages to chemical evolution: (1) making simple organic compounds, (2) chaining these together to form the complex molecules, such as amino acids and nucleotides, and lipid membranes, and (3) replication.
1. Simple organic molecules came into existence on the early Earth via carbonaceous chondrite (meteorites), and/or underwater hydrothermal vents, or possibly lightning interacting with methane. We know this is likely because we can examine these things today.
2. Clays and other minerals can act like catalysts to create larger organic compounds. More interestingly, if you put lipids in water, they form little “bubbles” or “spheres” about the size of a cell. Spontaneously. These little bubbles even divide under certain conditions. All cells have lipid membranes.
3. The “RNA world” hypothesis is strongly favored nowadays. Basically, cells reproduce by DNA encoding proteins, but proteins are used to create DNA. So it seems like a chicken-and-egg. However, RNA can fulfill both roles. So most scientsts believe that the earliest cells (or proto-cells, or wahtever) were lipid bubbles with RNA that acted both like simple DNA and simple proteins.
None of these steps is remotely miraculous, or even unlikely. Like I said, we can observe some of these things today (such as lipids forming bubbles, the molecules created by hydrothermal vents, and the behavior or RNA).