Hammers invested in a unit don't last forever. If you put, say, 20 hammers into a warrior on turns 5-10, switch to building something else on turn 11 and then don't return to build the warrior until turn 40, those 20 hammers will have decayed to approximately 10 hammers at that point.