Compressors don't get the luxury of oil changes
You know how the oil in your car breaks down after a while, meaning you have to take your car over to the local quick-lube or up onto the jackstands in your garage and have the oil changed (or do it yourself)? Well, there's oil in your air conditioner too, mixed with the refrigerant, and it breaks down due to heat and traces of moisture just like the oil in your car does. Worse yet, when was the last time your air conditioner got its oil changed?
As a result of this oil breakdown, it turns into an acidic, sludgy substance that has very poor lubricating properties, causing the compressor to work harder. Atop this, the acids attack the insulating varnish in the compressor windings, causing it to break down and lose its insulating ability. As a result, the compressor "burns out", either from being no longer able to spin due to a lack of lubrication or internal shorts in the windings due to the broken-down varnish.
It's possible to catch this ahead of time, by having an HVAC technician use an insulation tester ("megger") to test the integrity of the insulating varnish when the system is commissioned and on a regular basis (such as on a yearly service call) thereafter. The resulting trend readings can predict compressor failures before they happen, and as a result, it's a common practice when maintaining commercial compressors.
Unfortunately, neither insulation tests nor oil changes are part of residential air conditioner maintenance. While changing the oil in an air conditioner requires a pro (it's mixed in with the refrigerant after all, so they have to swap the refrigerant charge out for a fresh one in the process), perhaps having it done every 5 or 10 years would be wise? It'd probably be cheaper than burning through a new compressor every 15 years or so, at least, especially considering that roughly half of compressor failures are due to internal wearout.