How do Mendel's ideas about the inheritance of traits relate to Darwin's theory of evolution by natural selection?
Biology was dogged for nearly thirty years by this problem. There was a rift between 'evolutionists' and 'geneticists', because the former claimed that mendelian variation (like yellow/green peas, blood types, etc.) was irrelevant for natural selection, and the latter argued that one would have to adapt evolutionary reasoning to mendel's laws (in the best case, but usually the 'geneticists' were by then fixists, that is, they denied evolution).
Ronald Fisher, Sewall Wright and John Haldane developed between 1918 and 1932 the mathematical basis for understanding evolution based on the mendelian laws of inheritance. Population genetics became the basis for what was called the Modern Synthesis and settled the above described dispute.
Any of their work is a bit hard to read, but instead of diverting to "popular" simplifications that do more harm than good, I would suggest reading the introductory chapters of the classical books they (and Motoo Kimura, another great developer of evolutionary theory) have written.
"Darwin was an English naturalist who showed that all species of life have descended over time from common ancestors, and proposed the scientific theory that this branching pattern of evolution resulted from a process that he called natural selection."
Although Darwin proposed this great theory, he was unable to state how traits were passed down to offspring. How did the traits of the parents work together in the offspring? Did they compete did they combine? He, as well as many others, believed traits were passed down and blended together averaging out the final outcome. What Darwin didn't know was that Mendel was working on just that topic. Mendel did not believe that traits were averaged out. Mendel who was later known as the father of modern genetics was able to prove the mechanism of heredity.