The above post is good. Another alternative is to get a good USB to SPDIF converter (Audiophilleo 2 is good) and a DAC with S/PDIF in. Some knowledgeable people claim the clock in the USB/SPDIF converter has more impact on sound than the DAC itself, but you will still need a DAC.
Yet another alternative is getting a DAC with asynchronous USB input, and go from iMac to DAC without the above-mentioned converter. Some examples: wavelength, Wyred4Sound, Ayre, Empirical Audio.
Yet another alternative is getting a DAC with asynchronous USB input, and go from iMac to DAC without the above-mentioned converter. Some examples: wavelength, Wyred4Sound, Ayre, Empirical Audio.