The way you hold the pencil and the position relative to the paper enables you to attain sharp edges – assuming, of course that you have a kept a sharp point on your pencil. That is of paramount importance.
Hold the pencil so that you are using the point and it is leaning over the object you are painting, like this:
…rather than like this where it leans over the background.