Cells come from preexisting cells, according to the cell theory compiled by Rudolph Virchow. The older cell theory developed by Theodor Schwann and Mathias Schleiden, which was eventually proven wrong by Virchow, assumed that cells could arise spontaneously.
The very first cells on Earth formed from aggregations of organic molecules, such as lipids, carbohydrates, amino acids and nucleic acids, such as DNA and RNA. These accumulations of organic molecules eventually organized into structures that developed membranes and cell walls that separated them from their environments. DNA and RNA were the molecules that were selected to carry the genetic material of cells so that they could make more of themselves. The earliest living things were probably single-celled prokaryotes.