The lens on a compact camera is the major moving assembly and faults/damage can occur.
The four main contributing factors are part failure, impact, liquid and sand damage.
Part malfunctions may occur even under warranty.