Focus stacking is a technique that can be used to increase the depth of field in all types of photography.
But especially in extreme macro photography it is a technique that is needed. When shooting with microscope lenses, it is often necessary with more than 100 photos, where focus has shifted slightly for each photo.
If many images are needed, it is necessary to have a macro rail, that the camera can run on. I use a Stack Shot macro rail with a small engine that can be programmed to take the desired number of images with the desired distance.
Special software is used to compose images to get a picture with great depth of field. The good software is Helicon Focus and Zerene Stacker. Helicon Focus is quick and easy to work with. Zerene Stacker is slow if there are many images to be "stacked", but in certain situations it can provide clearer images. There is a free program called CombineZP that gives good results. It is also slow if many images are to be "stacked".