I think that it must be instinctive in animals as I kknow when My Found Cats have been ill, the Other Cats gather around them to impart thier warmth and let them know that they are loved.
And when I had the amputation of the little toe on my left foot, they would sit by the foot, to show how much they cared.
And now that My Princess and Juke Joint Joseph are ailing I will try to help them as I did for My Angel Cats when they were ill too.

Its the animal thing to do