A model of an enzyme reacting with another molecule and
breaking it into two pieces. Each little ball represents an atom.
This enzyme, lysozyme, breaks up bacteria in your blood
to keep you from getting sick.
An enzyme is a kind of big, complicated protein molecule, made mainly of hydrogen and carbon atoms, but with some other atoms as well. Both prokaryote and eukaryote cells use enzymes (ENN-zimes), so the first enzymes probably evolved around four billion years ago, together with the first living cells.
Prokaryote cells assemble enzymes in their cytoplasm. The cell's DNA molecule uses enzymes to assemble RNA molecules, and these RNA molecules then in turn assemble more kinds of enzymes. The cell pushes some of these enzymes outside the cell to digest food by breaking it apart into smaller pieces that can get through the cell membrane. Other enzymes can digest smaller molecules floating in the cytoplasm inside the cell. Some enzymes grab two small molecules and attach them together to make a larger molecule, like a lipid to fix the cell membrane. When the enzyme is done, it lets the new molecule go, and it's ready to grab two more molecules and do it again. Each kind of enzyme has its own shape, and it will only work with molecules that fit into it exactly, like having the right puzzle piece in a puzzle, or the right key for a lock. That way each kind of enzyme can do its job and not interfere with anything else in the cell.
Eukaryote cells make enzymes in the endoplasmic reticulum, following instructions from the cell's RNA. Then those enzymes, in turn, build more enzymes, and the enzymes float out of the endoplasmic reticulum into the Golgi bodies and then into the lysosomes, where they break down large molecules of food or garbage, or into vacuoles, or into the cell's nucleus where the enzymes help repair the cell's DNA or build more RNA molecules. Some enzymes float around in the cytoplasm where they can break up viruses or germs that attack the cell.
New enzymes appear accidentally, when a old kind of enzyme accidentally gets broken or forms wrong. Usually these broken enzymes are no good to the cell, and sooner or later the enzymes in a lysosome break them down and recycle their parts. But sometimes it turns out that the broken enzyme happens to be the right shape to match up with, for instance, a new virus that is trying to invade the cell and kill it. Maybe the new enzyme can break up that virus and kill it instead, saving the cell. If the new enzyme turns out to be useful, then cells that make that enzyme will survive better, and the cells that don't make that enzyme will die of the disease that virus causes. Measles is an example of a disease that we're now better at surviving that we used to be. Your own cells each make more than a thousand different kinds of enzymes.
Even in eukaryotes, some enzymes still leave the cell to digest food outside it. In your own body, you'll find some of those enzymes in your stomach or in your saliva (spit). Those enzymes break down your food so it can get into your cells through the cell membrane.