I've always liked that quote from Karl Malden in Polyanna. It seems to me to encapsulate the human condition. Doctors have told me that dead people frequently have a surprised look on their faces, even if they have been ill for some time.
Except that people seem to be aware when it is near for them.
The other day a friend was telling me about his mother, who, well in her 90s, still spent a lot of time checking her bank balances, even though she could hardly move. She hated being deaf and less than able. Conversation became difficult.
And yet she clung on.
My friend was slightly surprised when she was finally taken to hospital and diagnosed with a blood clot. She died quite quickly thereafter.
My friend had been in a very difficult situation for many years, but finally, recently, the position had resolved itself, both in his own mind and in fact.
I would maintain that the old lady kept going until she knew my friend was settled and that everything would be all right. Although he had never spoken to her about it, I would suggest his demeanour told her everything she needed to know.