It’s probably not necessary to define “sympathy,” the feeling of commiseration for the problems of another. (But I just did.)
“Empathy” is not just a fancy synonym for “sympathy.” It contains the idea that the empathic person holds a very deep understanding of the problem or feelings of another, often with the idea that the listener has experienced that same troubling situation as the speaker or writer.
If you are divorced and your friend is telling you about his painful split from his partner, you can certainly be empathic. You have gone through a very similar situation. If you have not been divorced, you are sympathetic. There is nothing wrong with that; but empathy denotes a much closer understanding of the problem.