Two causes, two repairs
Above each lens sits a small cover glass, which is a separate part. If it's scratched or cracked, it scatters the light. Photos then look pale and hazy, but the camera still focuses sharply.
Underneath is the camera module with autofocus and image stabilisation. Apple describes how this works: a gyroscope detects movement, and the lens moves against it so the image stays steady. On newer iPhones, magnetic sensors also measure the position of the lens. If this mechanism is damaged, the image becomes blurry even though the glass in front of it is intact.
The distinction matters because these are two different repairs. With a glass replacement the camera stays in the device; with a module replacement the camera itself is replaced.
