My rat was euthanised today and I am unsure what to do to help her cagemates feel better about it. Can they even understand death? Will they grieve?
(This information goes for all social rodents and non-rodents including mice, gerbils, and degus.)
This matter is briefly talked about here.
While no one knows for sure what, if anything, animals understand about death, rodents do understand absence, as in: my friend is missing. Just as they are happy to see you after a while, they are happy to see cagemates after a vet visit, for example. If one of your rats dies while away from your other rats, they will know that he is missing.
Rats (and other rodents) do experience grief. I have known a rat to essentially die of grief, and had another rat who lost a significant amount of weight following her sister's death. Symptoms can vary - they may be a little 'down' for a while then return to normal, they may stop grooming themselves or refuse food they used to love, or they may not react at all. It varies. Rodents can get depressed, and the symptoms are pretty much the same as in humans. If your rat is grieving, be sure to keep an eye out for a mite infestation, which can flare up if a rat stops taking care of itself.
To alleviate the symptoms, the best thing to do is to show your rats the body. When shown the body of a cagemate rats will repeatedly sniff its mouth and nose, perhaps pulling back the lips to sniff the mouth. While there is no circumstantial proof, I strongly believe they are checking for breath, and comprehend that there is no breath (chimps do the same thing). They understand that their friend is gone, and not just "away for a while". They may groom the body, or stand on it to provoke a reaction. They will eventually lose interest, it could be a few minutes or several hours. You must never leave your dead rat with them unattended; it is unfortunately a prey animal's instinct to 'dispose' of a body as it may attract predators.
After being shown the body, your rats will no longer wait for their friend to come back. They may still grieve, and you can help by carrying on as normal - don't leave them alone to 'give them time to grieve', you are a part of their pack too and they will want to see you, and they need to remain active and stimulated. In fact, give them extra attention, and extra yummy treats. Chocolate helps humans who are sad, and it boosts energy in rats too. Make sure they are eating properly and not losing weight. Remember that mycoplasma can flare up during times of stress.
If, after a death, you are left with only one rat, it is strongly recommended that you get another rat as soon as possible. Do not give the rat time to get over it - they naturally live in large groups and need companionship. They won't want alone time like a human might. Adding loneliness to grief is not a good idea. They process things in groups and take behavioral cues from each other, and they need each other's comfort.
A final (quite sad) source on general animal grieving.