A good submissive is generally in-tune with his/her/its dominant.
When the dominant is in a mood, for whatever reason, the submissive will be able to feel (at least part of) whatever emotion the dominant is feeling.
The submissive naturally wants to comfort the dominant, even if the submissive was not the one who upset the dominant. Just like the dominant is responsible for the submissive, it is also the submissive who is responsible for the dominant (in a way).
At least, in my experience. My submissive(s) that I have been with have always been able to tell when I'm happy, disappointed, upset, etc. and will do the best he can to try to make me feel better, whatever the cost.
Empathy. And paying attention and knowing your dominant.
(This is all from my POV. I am in no way saying I'm 100% correct.)