An integrated device controls the position of the lens by sending an ultrasound or infra red light. These waves reach the subject and bounce back. The time that elapses between the emission and receptions tells the camera how far away the subject if.