In 1858, there were lead pencils and there were erasers. That year, Hymen Lipman received his patent for putting the two together. A few years later, in 1862 Lipman sold his patent to Joseph Reckendorfer for $100,000. that was quite a fortune at the time.
Reckendorfer sued the pencil company Faber for infringement. The Supreme Court of the United States ruled against Reckendorfer declaring the patent invalid, because his invention was actually a combination of two already known things with no new use. Faber is still in business making pencils and crayons.
The word "pencil" derives from the Latin word "pencillus", meaning tail or little brush. A typical pencil can draw a line 35 miles long, or write about 45,000 words. You cannot get lead poising from pencils, because they do not contain lead. More than half of all pencils are made in China. The typical six sided pencil uses less wood to make than round, is easier to sharpen, and has better grip to not roll off of a surface. There is no reason for the yellow color and many countries do not paint their pencils yellow.