Evolution occurs though mutations. Random mutations happen often amount organisms but a small portion of these mutations can aid an organisms survival.
Natural selection
Natural selection is truly survival of the fittest. The organism most well adapted to their environment will survive to reproduce. But the giraffe did not grow tall because the trees got taller. Evolution requires random mutations, mistakes in an organisms DNA that causes a difference between it and its population. Most of these mutations are detrimental or ineffective but some mutations might help an organism to survive. If an animal develops a trait that helps it survive it will live to reproduce and pass on that trait to help its offspring survive. so when the trees got taller a mutated giraffe happened to be tall enough to reach the leaves and fruit. It was able to eat and pass on that mutation while the shorter giraffes starved and were unable to reproduce. Only mutations can be passed on through reproduction, the organism had to be born with this mutation in their DNA. A trait that was not acquired through a natural mutation cannot be passed onto an offspring. Obtained traits cannot be given to offspring. For example, a bird encounters a predator but escapes losing a leg. This missing leg is an obtained trait, so if the bird lives to reproduce, the offspring will not be missing a leg.
Artificial selection
evolution is a natural process carried out by nature. Unlike natural selection, artificial selection is the act of humans controlling evolution. for example a farmer has several species of corn but only some of the corn has good qualities. So the farmer only lets the good corn reproduce. this makes an artificial evolution in which humans decide which organisms are allowed to reproduce.