That is the question and an important one, batteries are a big investment.
My personal opinion is it's not so much the cells in the battery but the electronics controlling, regulating and communicating both the battery and tool. When the electronics faultier kiss the battery goodbye, the lithium won't charge or discharge correctly. I've only had 1 battery do this, a Milwaukee 9.0 at 2 yrs 10 months of a 3 yr warranty and Milwaukee replaced it at no cost.
I owned batteries from Bosch, Dewalt, Milwaukee and Craftsman. If you read all these sites that talk about actual Lithium, they all seem to say that the lithium degrades even if sitting on a shelf and the longevity is no more then 2-3 yrs. Well the first platform I bought into was Craftsman C3, buying only a driver drill and 1/4" impact, then a sawzall, 4" grinder, impact wrench, vacuum and radio, with a bunch of 2.0&4.0 batteries. I beat the crap out of those tools and not 1 gave up, then I gave them all to a friend. It's now 6 years later and those batteries are still going strong.
These "experts" also say that heat is the worst thing for these batts, however I have a friend who lives and works in Florida, working exclusively on sea docks, walls and boat houses, mostly PT material. He runs Dewalt 20v tools and has alot of those newer XR 6.0ah-20v batts (21700 cells) and doesn't seem to be having issues. Anyone who's been to FL, knows there's no shade and gets quite hot.
2 points; (#1) The company also uses Milwaukee 18v as well, so their building all of these board walks and structures out of PT and only using the 18v platforms. (#2) The flexvolt 6, 9 & 12ah and the newer XR 6 & 8ah batteries all use the same larger 21700 cells (food for thought).
Now both Dewalt & Bosch are recognizing (perhaps witnessing Milwaukee) that the 18v platform has not reached it's limits yet and are designing and/or upgrading their existing 18v tools to work with these larger 21700 cells which hold and deliver alot more energy, which is a good thing for their loyal customers.