Around two billion years ago, when all cells still lived in the ocean, a few of the earliest cells, or prokaryotes, evolved into more complicated cells called eukaryotes. They seem to have done this by enclosing several different kinds of prokaryotes inside another prokaryote.
At first this happened by chance, probably because one cell was trying to eat another cell. But it turned out that this whole group of prokaryotes could then all work together, cooperating to increase everyone’s chance of survival and reproduction. Because more of these cooperating prokaryotes survived, they reproduced and kept on cooperating. The cells that are part of your body, and that are part of trees and other plants and animals, all still work this way.
One kind of prokaryote that evolved to live inside another cell was a chloroplast. A chloroplast is basically a prokaryote that can photosynthesize – and now, instead of just producing energy for itself, it produces energy for a larger cell, and in exchange the bigger cell keeps the smaller one safe inside it. All plant cells have lots of chloroplasts inside them. Chloroplasts still have their own DNA molecule, separate from the cell they live in.
Another kind of prokaryote that evolved about this time to live inside another cell was a mitochondrion. Mitochondria use oxygen to break down the sugars that the cell eats in order to make energy for the cell. Mitochondria could not evolve until about two billion years ago, because that was the first time that there was enough oxygen in the atmospherefor them to use.
Most eukaryote cells also have other specialized pieces inside them that help them. These other pieces seem to have evolved gradually inside the cells, probably when enzymes mutated into new enzymes that built lipid membranes inside the cell instead of only around it. Some of these pieces are the nucleus, vacuoles, the endoplasmic reticulum, golgi bodies, and lysosomes. Some eukaryotes have eyespots. Eukaryote cells are about ten times as big as prokaryote cells, so they can hold all these pieces.
Most eukaryote cells still live independently, as one-celled creatures like yeast. But starting about 600 million years ago, a few eukaryotes evolved into multi-celled creatures, beginning with small simple animals like the hydra, and ending up with complicated creatures like people. Other eukaryotes live on or in animals. Some of these are helpful – you need bacteria in your intestines to help you digest your food. Others are harmful, like the germs that cause cholera or typhus. Usually the harmful bacteria are just newcomers, and they gradually evolve into a more helpful role.