The first few years my wife and I were married, we had a dog named Doolin.
At least I think Doolin was a dog. The story is that she was born to the unholy union between a border collie and a bluetick coonhound, but there's credible evidence she was an alien infiltrator from the planet K-9, sent to study humans by pretending to be a humble house pet. My observations suggested that she was far smarter than humans but had only recently mastered pretending to be a dog. She is, far and away, the weirdest dog I've ever met, and I've had dogs pretty much my whole life. She figured out how to unlatch our gates (and let herself out) by watching us; we ultimately had to put carabiners on the latches to stop her from going on walkies by herself. She valiantly attempted to herd our four cats, an effort that was ultimately unsuccessful. Of her many odd habits, one of the funniest was that she was never without her favorite toy, a plush jack that she carried around in her mouth -- always pointing the same way. (We tested this by taking it from her and sticking it in her mouth the other way 'round. She dropped it, looked at us as if we'd lost our minds, and picked it up from the other direction.)
One of Doolin's most curious traits was an extraordinary sensitivity to us, particularly to Carol. She seemed to watch us continuously for cues about what was going on, and sensed when one of us was upset or feeling unwell. Most strikingly, Doolin always knew when Carol was about to get a migraine. Starting about a half-hour before the symptoms began, Doolin followed Carol around like her shadow, and if Carol sat down, Doolin smushed herself right up against her. It got to be that Carol knew when to prep for a migraine once she saw Doolin acting weird (well, weirder than usual, which was admittedly a pretty high bar).
I used to think that people claiming their dogs had a second sense about how they (the owners) were feeling was an example of people anthropomorphizing, or at the very least, exaggerating their pets' intelligence and emotional sensitivity. Until I had lived for a while with Doolin.
After that, a lot of the stories I'd heard began to seem a good bit more plausible.
Just this week, some research supported the contention with hard evidence. A team of scientists in Belfast studied the responses of four dogs to breath and sweat samples from thirty-six volunteers, before and after doing a stressful exercise -- counting backwards from 9,000 by intervals of 17, without using calculators or pen and paper. The researchers laid it on thick, telling the participants that it was very important to the study to do the counting exercise quickly and accurately. A wrong answer got a shouted "No!", followed by being told the most recent correct response and an instruction to pick up from there. For most of us, this would be a pretty high-stress activity, and would cause stress hormones (like cortisol and epinephrine) to pour into our bloodstreams.
And the breakdown products of those chemicals end up in our breath, sweat, and urine. What's remarkable is that the four dogs, which had been conditioned to be able to discern between samples containing those breakdown products from ones which did not, correctly distinguished the post-stress breath and sweat samples from the pre-stress ones 93% of the time.
I know that our current dogs are pretty sensitive as well (although nowhere near the level of acuity that Doolin had). Cleo, our Shiba Inu rescue, is really keyed in to me especially. I had a couple of seriously high stress things happen in the last couple of months, and whenever I was really in freak-out mode, Cleo followed me around with a very worried expression on her face. Her curly tail is like a barometer; the tighter the curl, the happier she is. And when I was struggling, her tail was sagging. Clearly an unhappy dog.
So I guess all this stuff isn't our imagination. Dogs really do sense our emotional states, not by some kind of canine telepathy, but because of plain old biochemistry coupled with an extraordinary sense of smell.
Although I wonder about Doolin. I still think she was an alien spy, and was relaying information about us back to the Mother Ship. Maybe the jack toy was some kind of transmitter, I dunno.