The pencil can be used for drawing 1-pixel at a time, or what is essentially a non-antialiased freeform brush. This is similar, but not the same, as using the Paintbrush with a brush setting of 1 and without antialiasing.
It can be useful to use the pencil tool with the grid mode enabled while you are zoomed in on an image to do per-pixel editing. In the following example, the pencil tool was used to draw the bottom and right edges of an icon:
Original Image
After using the Pencil Tool to complete the image