What is the advantage of optical TOSLINK over RCA coaxial cable?
In addition to the answer of TimB, there is another advantage of this optical communication.

With RCA, the two networks connected have to be referenced to each other. In the case of optical, there is galvanic isolation between the two. As a result, there might be less issues with ground loops, networks can remain isolated, etc. It also means that the grounds can't act as a big antenna which might make it easier to get low noise in the system as a whole.

And additional disadvantage of the RCA connectors is in the ground connection. If you look at most modern connectors, you will see that the ground connection is made first. As a result, the two circuits being connected are first pulled to the same potential, and then the actual data is connected. If data is connected first, this still happens - but the currents to do so now have to flow through your likely far more sensitive digital receiver circuits. In the RCA connectors, the first connection is the center pin that carries the data. For this reason I have often been told that you should always connect the RCA connectors first, before connecting the entire system to the mains voltage - or use the ground lug that some of these devices have to reference the system to mains earth at all times. 
Needless to say, this issue is not present in the optical versions, and thus they are more suited to hot-plugging.