Optical cannot handle higher resolution audio files. SPDIF can.
’spdif’ (sony philips digital interface) is a digital music data transfer format that can be transmitted/received either optically (toslink) or electrically (rca/bnc)
https://www.lindy.co.uk/spdif-connections-explained-i70
optical spdif has some bitrate limitations, yes, relative to electrical spdif