The cores in #2 pencils are softer because they contain less clay. A pencil core is made from a mixture of clay and graphite. The core does not contain lead.
Graphite is a non-toxic black mineral that leaves dark marks, making it the ideal tool for writing and art projects. Graphite's soft and brittle nature require a holder, which lead to the invention of the pencil.
When a #2 pencil is used its softer core breaks easier than #3 pencils, leaving a larger quantity of graphite (black deposit) on paper. As a result, the marks are darker than those made with #3 pencils.
Since a #2 pencil deposits more graphite with each use, its core tends to diminish faster. That is why you need to sharpen the pencil.
Number 2 pencils are more widely used in schools and workplaces because their levels of darkness and softness make them a good choice for regular, everyday use.