Amost every cat owner or cat lover I know will tell you that their cat knows how they are feeling. They know if you are happy or sad or angry. They are extra cuddly or sweet when you are feeling sad as if trying to comfort you.
It is difficult to say for certain that cats know how we feel and adjust their behaviour accordingly. However, research by Quaranta et al (2020) suggests that cats do indeed recognise happy and angry emotions in other cats as well as people. The also link audio recordings of angy or happy sounds to the correct visual representation of the emotion. When they heard angry sounds they looked longer and more intently at the face with an angry expression, of a cat or human. When they heard purring they looked at the picture of a cat with a content facial expression and when they heard a happy human voice they looked at the picture of the smiling human.
It also seems that the cats in this study showed more signs of feeling stressed when confronted with an angry human; however, this needs further research. If cats do indeed feel stressed when a person is angry then this indicates a functional understanding of anger in humans. It would mean that cats have learned that this emotion in humans may well have negative consequences for themselves and therefore they adjust their behaviour accordingly to avoid this.
What this study definitely shows is that cats have developed social skills that allow them to understand human emotional signals. This skill is important for domesticated cats as it helps strengthen the bond with their owners.