My cat Jane always comes to cuddle when me or one of my roommates is crying or upset. It's the sweetest thing, and exactly what you need on a bad day. I've also had pets that didn't seem to notice or care, or showed their concern in different ways. My cat Daria would prowl when I seemed upset, presumably to secure the perimiter. I think some individual animals are more sensitive than others, just like it is with humans.
Pets have a vested interest in their owners viewing them positively and ensuring that their human is able to maintain its food-and-shelter providing functions. So it makes sense to me that, after years and years of breeding, many of them would be good at (and interested in) helping their human buddies to cope with life's emotional ups and downs. I see it as mutually beneficial evolution. Perhaps it's not as selfless as it seems at first glance, but I still think its adorable, and I will continute to encourage it.