That is such a multi-faceted question that is hard to truly answer. There are factors from the quality of steel initially used in construction to the type of conditions and maintenance the vessel has seen over her life. Higher-end yards like Meyer-Werft are typically going to use a high grade steel unless the customer specifically requests one of a lower tier.
How often ships are not on DD'ed but undergo actual hull maintenance, not just touch up paint, during DDs plays a huge factor. I challenge many of you to look at as many photos as you can of other ships in ports and see how their waterline is maintained against DCL vessels. After you do that, take a look at other areas of the ship and see just how much you notice rust vs on DCL vessels. If areas are allowed to corrode then metal is gradually disappearing; with that metal disappearing you are losing tiny bits of structural integrity that then causes stress and premature wear in other areas. You then get a cascading effect of wears on the vessel.
How many times the vessel has gone through heavy seas is another big factor in life-span. If you could see the frames of the vessel from bow to stern, then you would see the ship flexing and contorting with the motion of the sea. That bending, stretching and compressing takes a toll after a while. Not only is it wise to avoid storms and heavy-seas for safety and guest comfort, but also for the overall lifespan of the vessel.
If a company takes a vessel that really has a comfort (for the engine) speed of 15kts but they run it 19kts and beyond on a regular basis then the motor is going to fail at an earlier point. That is another negligence on the part of the cruise line itself. Rings, bearings, windings, valves, etc all have a pre-determined life of when they should fail at the earliest. Some companies have a tendency to try and push beyond recommended and/or ignore inspection/overhaul intervals.