You have to know them to understand, but they do.
When they are missing someone, they look for them, call for them, and wait for them in their usual places.
After a while, somehow they know their person isn't coming back, and it's heartbreaking to watch.