Coax and Optical digital connections both use S/PDIF as the communication protocol - they are one and the same, except for the fact that one is electrical and the other is optical.
HDMI can transmit high bandwith digital audio, like 5.1/7.1 PCM whereas S/PDIF cannot because it would exceed the bandwith limitations.