Why wouldn't they understand it? Death is a natural process.
They may not be aware of their own mortality. But they can tell if another animal has died. And that if it has died it isn't coming back.
It's common advice to let dogs see and smell the bodies of their deceased companions, so they know they aren't coming back.
You've already said they react in a particular way when people or other animals they care about aren't around anymore. That's grieving.
> I have no idea idea why people are voting this down
Because you're stating something incorrect, confidently.