*For the most part*, only the batteries.
In my last job, one of the things I did for almost 20 years was purchase, maintain, and replace about ~100 UPSs. Over those nearly 20 years, I did have a very small number of UPSs actually fail. Typically, the charge circuit would start over-charging and ruining batteries, but at least one just failed dead. But, for the most part (and we talking >90%), all of the UPSs just kept ticking for nearly two decades, just needing battery changes.
Buy good batteries. We replaced batteries every three years, even if they were still running. With good batteries, we would see *zero* failures during that time. With lesser brands, we would see ~5-10% failure during that time. At one time, my boss made me buy batteries of some unknown brand from one of our partners "to build relations with them". Of the pallet of batteries that we got, we had ~50% failure within a year, and many of those actually spewed acid and badly corroded the wires/chassis.