In the early 19th century there was a French scientist named Lamarck, who developed an explanation of how life forms change and why. Lamarck proposed that life forms change in response to their environment. If the giraffes in one particular area needed longer necks to reach their food than those in another area, then they will have developed longer necks by virtue of stretching their necks to get the food.
Life adjusts to the environment according to the needs of survival.
The basis of his theory was that a life form developed what it could to survive, and those acquired characteristics eventually became a heritable feature of that animal or plant. For decades, Lamarck was hailed as the great scientist who had discovered the process of evolution. Today he is hardly known outside of science history courses. Lamarck was displaced by Darwin, who just reversed the Lamarckian view. In Darwin's theory, nature ruthlessly selected only those individuals who were best suited to survive.