Autofocus works by using a sensor on your camera to see what you are trying to photograph. The autofocus sensor looks for contrast in the image, which can tell where something is located.