Most hens will produce fewer eggs as they grow older, and there will be big differences between individuals in the flock. Given good care, diet, etc, genetics and luck matter. Predation may remove some hens, so they aren't going to reach their full lifespan. Then nearly nobody breeds for longevity, so when parents are all under two years of age (or maybe one year old) there's no way to know who might do better longer. It's about the economics of egg production, and both production and fertility will drop off over time. ESPECIALLY when it's ignored in breeding stock selection.
Heritage breeds might do better longer, but again it's about parent selection.
If you plan to breed birds in your flock, your choices will make a difference in future generations.
Mary