This is how focus stacking works.




The animation shows the captured images, while the static image is the result of merging them.