Unless the specimen is completely flat, It is likely that some parts of the image are not in focus. The depth of field depends on both the objective used (high magnification objectives have a lower depth of field) and the condenser aperture diaphragm setting. A low depth of field is not necessarily a disadvantage. By focusing only on the parts of the specimen which are currently of interest, other disturbing parts which are outside the focus plane, such as dust, can be made to blur away. In other cases it is more desirable to have an image of a specimen which is in focus throughout. Especially three dimensional objects, such as rock samples and insects appear much more spectacular if all of the specimen is sharp.
Sacking refers to the combining of several micrographs of different focus, into one image in which all parts are in focus. It is necessary to take a series of picture turning the fine focus know between the pictures by an appropriate amount. The program will compare consecutive images and then determine which parts of the image are in focus and which ones a not. It will then combine the sharp parts into one final image.
Focus stacking can not only be done with pictures taken under a microscope, but also with digital cameras that are equipped with a macro lens. In this case the camera is placed at a fixed distance from the object and the focus is manually adjusted for each image. You need to be aware, that refocusing the image may also change the magnification of the picture somewhat. By focusing a camera objective, lens elements are moved further away or towards the sensor of the camera. this also changes the final magnification of the specimen and the program may have problems properly stacking the pictures. When using microscopes, this is not an issue, because the objective to specimen distance does not change.