I'll be brief: How do digital photo sharpening tools restore edges to photos? Why do they only sometimes work? Why don't they restore the image perfectly i.e what are the limits of the tools?
Sharpening tools are basically faking sharpness by exaggerating the contrast between the two sides of an edge.
E.g. if you have a dark surface against a bright background, you can make the edge appear sharper by darkening the pixels on the dark side of the edge, and brightening the pixels on the bright side of the edge.
Top half is the original, bottom half is sharpened. Illustration from wikipedia, which also has further explanation.
Sharpening tools don't "restore" anything, they merely put a bit of makeup on whatever data we feed them.
There are large number of techniques used to sharpen and limits keep expanding (checkout the newer tools to fix shake/motion induced blur -- sort of a post processed version of IS).
The oldest techniques would generally look for areas of contrast and then increase that contrast. Moving forward from there are the edge detection algorithms that look for edges of contrast and increase the sharpness along those edges.
The limitation of all these tools is that you cannot get more information out of an image than is already there -- of course smart people are always trying to improve on how far we can get with what is there (and there is a lot of information in a shot from any semi-modern camera).