Focusing (from Latin: focus - hearth, fire) is the process of aligning the optical image of the subject with the plane of the light receiver.
Due to the imperfection of any optical systems, in particular, shooting lenses, instead of an image of an ideal point, a spot (circle) of scattering is obtained, the shape and dimensions of which depend on the position of the plane on which the image given by the lens is obtained. By moving this plane along the optical axis, you can get two of its positions corresponding to either the highest resolution of small details (highest resolution), or the highest sharpness of the contours of their images (borderline unsharpness).
As the optimal position of the image plane, given by a particular lens, its position is taken, at which the most advantageous combination of resolution in images of small details with their sharpness and clarity is obtained. This plane is called the "best fit plane". In the process of focusing, it is desirable to combine this very plane of the optical image with the plane of the photodetector.