High production layers are prematurely aged at 2 years old but that doesn't mean they can't live for years more, in good health too. I'm assuming she's one of that breed, but feel free to correct me if I'm wrong! They kill those hens at such a young age for a few economical reasons, as stated above too, an example being that at over a year old they may begin to lay one egg less per year. It's not because they're old; far from it.
Many people think 10 is ancient for a dog or cat and it's just a species-specific thing, but wild counterparts of dogs and cats (their ancestors, like Wolves, Wildcats, etc) are capable of living for twice that. We severely restrict the lifespans of our domestic animals and then think that's normal for the species rather than a direct result of our breeding and feeding habits inflicted on their species for countless generations. It's now gaining more recognition that it's more breed related than species related and has a lot to do with what we fed them and how we kept them. Hence why some people's cats and dogs live twice their littermates' lifespans. Diet and lifestyle have a lot to do with it.
I knew one purebred Silkie hen who was still laying full clutches of eggs at 14. Plenty of hens are still laying into their teens, if anybody allows them to reach that age, and if they're not of some intensive production breed whose genetics compels such overproduction that they're burnt out before they hit the normal prime age of any other hen.
Their diet has a lot to do with it, too. They restrict fats so they don't become too fat to lay, and all the oils and proteins are cooked, which is basically how you feed for heart disease and premature decrepitude and death. If you take her off layer pellets and just put her onto a normal diet for pet or breeder chickens, she will do much better. But she'll lay less as her body can now slow down from harmful overproduction into producing within her health's capacities.
In fact, chances are she's laying less because you're giving her a good diet, if she's a high production laying breed, that is; give them what they truly need, not what the financial bottom line of the egg factory needs, and they stop producing so heavily. Otherwise, they produce heavily on what is labeled as a 'complete diet' but which is actually a subsistence survival ration, the barest bones of nutrition, sufficient to keep them alive and producing in the short term, the intended recipient of which is expected to be killed before the diseases of malnutrition set in. It's not complete at all. It's one of the reasons they're prematurely aged before they hit their prime. If raised on this diet, once they're taken off it, they often stop laying for a while as they are finally able to redirect their dietary intake into rebuilding their own bodies, attending to their health, instead of ceaseless production; they will start up again once they've rebuilt, but won't lay as heavily as before. But they will lay for many years longer than their commercialized counterparts.
Being able to free range appears to be a fairly necessary thing for longevity. The stimulation it provides, as well as the detox and nutrients they get from grass, insects, etc, does wonders for their health. Exercise is also one of the biggest determinants of lifespan, and being free of the constant stress of caging is also good for them.
Best wishes.