An AC compressor can fail due to the following factors:
Dirty Coils and air filters
High voltages
Low levels of refrigerant
Overheating
Lack of insulation