Even though pencils are called “lead pencils,” they do not contain lead. The material that makes a pencil write is a mixture of graphite (a kind of ground carbon), clay, wax, and chemicals.
To make a pencil, dried, ground graphite, clay, and water are mixed together at high speeds. The mixture is put into a machine which squeezes it out into a long black string. This string is cut into pieces of pencil-sized lengths, which are then baked in an oven until they are hard. A wax coating is then applied to the pieces to make them write smoothly.
The hardened strings are placed in grooves of wood cut to the shape of half-pencils. Then another piece of wood with similar grooves is pasted on top of it. With the graphite string now inside each “sandwich,” the grooves are ready to be cut into individual pencils, sanded, varnished, and have their metal tips and erasers attached.
When you sharpen a pencil, you are actually removing this wood casing to reveal more of the graphite. As you write, tiny bits of the soft graphite are left on the paper, creating the words and pictures.
Colored pencils are made much the same way, except that coloring pigments and dyes instead of graphite are mixed with the clay.
The ancient Greeks and Romans actually used pieces of lead as pencils!