I recently came across an interesting story of a South African conservationist named Lawrence Anthony. He was known for his conservatory work amongst elephants.
It is said that just after Lawrence's death in his house, a group of elephants marched their way to his house for 12 hours, and hung around for two days before making their way to the bush.
https://protectallwildlifeblog.com/2021/08/01/when-the-elephants-came-to-mourn-the-elephant-whisperer/
Imho, I think , considering this case study, animals are somehow capable of intuiting the state of close friends and responding accordingly.