The normal life of a CMOS battery is 3 to 5 years. To be honest i've had them last up to 6 years. It is diffcult to say why your battery has died after just two years, it maybe just an inferior battery. I suppsoe you could ask the same question about a watch
battery. Why does one battery last 12 months and another 18 to 24 months?
CMOS batteries are not that expensive and are easily changed, so long as you know where to find it on your motherboard. With some motherboards you cannot miss the battery whereas others it maybe hidden by wiring or somthing similar.
I wouldn't worry about it only lasting 2 years, just change it and, hopefully, this next one will last longer.
This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.
I've never had one die on me. Either I just got lucky (with all 8 computers I owned/use/service) or most people use their computers in a way I don't to allow the CMOS battery to die so quickly.
I've had 3 computers break before the CMOS did. one hard drive failure, one graphics failure (laptop), one power supply failure (laptop).
I don't think there's much you can do in terms of care that can affect the CMOS battery life. It's not like you can give it a good cleaning from time to time (not that i needs one either) like you can clean the outsides and dust the insides of a computer.
its just a little battery sitting on the board that you pretty much ignore 99% of the time.
In fact, I've never had a rechargeable battery die on me either. maybe I have the magic touch? my batteries never develop memory or loose capacity.