This is a very very good question for every chicken keeper to consider. Along with what to do with unwanted roosters. The answers will be different for each person, and everyone is free to do whatever feels best for them.
But it must be taken into consideration, and best done as early as possible in your chicken-keeping experience. That way you don't get stuck with a lot of free-loading old hens you were expecting to give eggs, and you don't have heartbreak eating birds you considered beloved pets.
I'm still fairly new to keeping chickens so I still have some of my original old layers. They all each have a name and a fan base and won't get eaten unless we're completely out of groceries. A lot of my old hens have already died of health complications (blowouts, internal laying, etc) or predator attacks.
I process all our extra roosters for the table. My kids won't let me name them anything but "Meat" although many of them have secret names known only to me. I don't see anything wrong with caring for and caring about the birds I plan to have for the table, just like I care for & about the produce I grow in my garden. I can love it right up to and right at the table on my plate, & on the plates of my family.
I read a great article in BackYard Poultry magazine about the superior flavor older hens have, and how rare it is these days to be able to sample it, since most of our meat birds are processed when they're very very young. But older hens are more flavorful, and make the best soup when slowly simmered, and have great health-giving properties. I can see where that might be a suitable end for an old laying friend, who faithfully gave eggs for a few years, then made a nourishing soup that fed her family, maybe even helped someone recover from an illness.