Many factors affect the life of a battery
CLIMATE: Colder climates tend to be hard on batteries from a starting standpoint, and for the fact that many people put their bikes away for the season when not using. Sometimes without charging properly. Hotter climates tend to discharge batteries quicker, and dry out batteries quicker. "Average" climates are the best for long battery life.
USEAGE: A battery that is used every day has the most chance of living a long life. Batteries that sit a lot, many times are neglected. This shortens overall life. Periodic charging is the best defense.
APPLICATION: How well is the battery charged in the vehicle? Some vehicles have better charging systems than others. Older bikes have worse charging systems than new ones. Are there a lot of extra accessories on your vehicle? Sometimes a battery has a hard time keeping up with additional electrical drains, thus wearing it out quicker.
SULFATION - Sulfation is a build up of crystals on the plates of a battery. This comes from not charging a battery properly. The more sulfation that builds up, the harder the battery is to charge, until finally it does not charge at all.
WATER LOSS - Water loss can come from overcharging, or just simple evaporation over time. This only happens with conventional batteries. This does not happen with sealed AGM batteries. Once the plates of a battery are left open to the air, above the fluid level, they can corrode very quickly. Corrosion can cause an internal short, and very quickly destroy the battery. Keeping proper water levels maintained is very important.
LACK OF CHARGING - As mentioned previously, lack of proper charging is the main reason that a battery will not last as long as it should. At the very minimum, a battery should be charged once a month if left unused.
COMPLETE DRAIN - Have you ever left your key on, and totally killed the battery? If recovered in a short time period, the battery should charge back to 100%. But every time this happens, it is similar to the battery having a "heart attack", and shortening its overall life. Always turn your vehicle off with the keyed ignition switch, not the "kill switch".
TYPES OF BATTERIES, WHICH IS BETTER...
SEALED AGM BATTERIES - Last Longer. They are not "open to the air" by way of a vent tube. They do not lose water. They are also packed tighter. Plates do not vibrate causing material to shed from the plates and short out. Or worse yet, simply breaking apart in some high vibration applications. Sealed AGM batteries typically last 3 to 5 years on average. 6 to 8 years is easily obtainable with proper maintenance. Typically sealed AGM batteries will give warning before completely dying. They will start slower, and require more charging. This is your clue to replace the battery. Typically they do not fail all of a sudden. Conventional "acid-filled" batteries have a harder life, for many of the reasons listed above. Conventional batteries typically only last 2 to 3 years on average. Although, 4 to 5 years is possible, in the best environments, and with excellent maintenance.