when you attach the final alligator clip to the positive end of the battery chain, you create a complete circuit, and that allows electricity to flow through it. As electricity travels through the pencil lead, which is actually graphite, it heats it up to an extremely high temperature causing it to glow and emit smoke.
*straight from the web! please re-word if necessary!*