In this day and age pets are living much longer than they ever used to not to mention many years more than their wild wolf and wild cat relatives. It's easy for some to say that it is not right to kill an animal when they are ailing because they should die in their own time. The fact is that the cat and dog were created from their wild relatives who didn't live nearly as long. Cats and dogs live so much longer than they ever would as a hunting creature with no protection from parasites, other animals, or the full protection we can offer pets from the weather. Beings that they live so much longer, they may develop many conditions that are untreatable near the end of their lives. Pets were just not intended to live long enough to die from the things that cause so much suffering. To say that a pet should die in their own time then we should not be doing anything to keep them healthier because their wild relatives "own time" is death by another animal, parasites, starvation, weather and even sometimes just trying to take down a meal, but only very rarely does a wild animal get to just die of old age. With our pets we are not playing God by euthanizing to end suffering because they would not have even lived as long if we had left them as wild animals.
If it wasn't for our better nutrition, parasite protection, sheltering, daily feeding, and all other vet care, our animals probably would not make it to the age that most do that causes many of their problems. Now there are those out there that come down with terrible diseases, cancers, and such at very young ages and you ask how its fair to euthanize such a young animal when they could live longer, but beings they have these ailments at a young age, it is possible in the wild they wouldn't have even lived as long as they have. The point here is that because we have bred animals and cared for them so well as to extend their lives, we must also be kind and end their suffering when they are in pain that can't be taken away or unable to do anything for themselves. When an animal is to the point that you can even see it in their eyes that they don't want to be there anymore, that they don't want to suffer through the illness, it is necessary to help them pass on.
It is important to realize that we have helped dogs and cats live as long as they do. Even for those pets that need to be laid to rest before they reach an old age we must see that some wild relatives never make it past birth, some only days or months, and the lucky few get to live for sometimes only a short number of years.
A pet is a responsibility not just because we chose to keep the pet, but because we have engineered them to live so long and because of that engineering they also may end up with conditions not present in the wild. We must be kind and end the suffering of our beloved pet if it is obvious that nothing can be done to alleviate it. When it is time to help your pet pass on you will know it because you know your pet best. How can someone say it is wrong to not let an animal starve because they can't or won't eat? How can they say it is wrong to end a constant searing pain some pets end up suffering with? Euthanasia for an ailing pet can be the last kind act you do for your beloved friend.