Charles Darwin spent five years on a voyage around the world on HMS Beagle. He collected fossils and living specimens, and on the Galapagos Islands he noticed that finches and tortoises differed slightly from island to island. Back in Britain he spent many years thinking about what this meant. He decided that species are not fixed: they change slowly over many generations.
At the same time, Alfred Wallace was collecting animals and plants in the Malay Archipelago. He reached almost the same conclusion on his own and wrote to Darwin about it in 1858. The work of both men was presented together that year, and in 1859 Darwin published his book On the Origin of Species, setting out a large amount of evidence. Their idea is evolution by natural selection: individuals in a species show variation, those best suited to their environment are more likely to survive and breed, and they pass on their useful features to their offspring.
Darwin and Wallace could not explain how features were inherited. Later discoveries in genetics, including how genes are passed on and how mutations create new variation, filled that gap. Today natural selection is the central idea of biology. It explains how species change over time, how bacteria become resistant to antibiotics, and how living things are related. At first many people rejected the idea because it challenged traditional beliefs about the origin of species, but the evidence has built up ever since.