Yes, they do. They are more aware of our emotions than we realize. At least that’s what my son-in-law, the animal person who managed an animal shelter for a while, says and I’m sure that he’s right.
Once, when I was just a bit depressed — nothing special, just a down day — the family dog came to where I was sitting on the couch, jumped up beside me and lay her head on my lap and stayed that way until I started to smile. Then she jumped back down and went on her way.
Another time, as I went to bed, my cat, who sleeps at the foot of the bed, came up and curled up beside me and stayed that way all night. As before, it had been a down day and he knew it and acted accordingly.
So my wip, A Very Black Cat, is right on when the cat character knows what people are thinking and acts accordingly.