system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does a camera know when the image is focused?

When you half-press the shutter, the camera adjusts and you physically see the image become slightly less / slightly more focused until it's done - how does it know that what it's showing you isn't blurry?
gpt
3 main ways:  
  
Contrast Detection Auto-Focus (good enough)  
Phase Detection Auto-Focus (best)  
Laser Auto-Focus (eh)  
  
When the camera picks what the objects it needs to focus on:  
  
Contrast Detection looks for the focus level where there is the most contrast (difference between white and black), as that means there is no blurriness, where they fade into each other.  
  
Phase Detection splits the light into 2+ beams and each beam goes into 2 sensors, and both sensors are focused until they are both "in-phase":  
> When the light reaches these two sensors, if an object is in focus, light rays from the extreme sides of the lens converge right in the center of each sensor...Both sensors would have identical images on them, indicating that the object is indeed in perfect focus.  
  
Laser Autofocus is just sonar with light, a beam of light is emitted from the camera and the time is takes for the light to bounce back to the sensor is used to determine the focus.