Let us describe a very simple system that does something we could label as empathyc.
A chatbot answers "I am sorry to hear that. What happened?" when we type "I feel bad", and it replies "I am glad to hear that. Fancy some music?" when we type "I feel good".
Somehow, it perceives a human emotion, and acts accordingly.
Why wouldn't this be a way of showing empathy? And, doesn't it fit into both paragraphs of your question?