Question: how does a camera focus work?
Answer: A computer inside the camera evaluates the signal from the autofocus sensor and commands the lens to adjust the focusing elements inside the lens until the two images appear identical. Once the two images match, the image is in focus. Early sensors just evaluated vertical details in the image.