Not only can optical and coaxial digital audio connections carry multichannel audio for surround sound, they can also provide crisper, more detailed stereo sound than an analog connection. These are especially good options when connecting video components that don't support HDMI but do offer digital surround sound.
Components that may offer digital audio connections include:
DVD players
cable and satellite TV receivers
some HD Radio tuners
some satellite radio tuners
gaming systems (usually via a proprietary adapter cable)