How does an optical (toslink) to HDMI cable/converter work?
That adapter is meant to be used with a soundbar that can only receive audio from a television via HDMI Audio Return Channel (ARC) connection.

Therefore the adapter gets power from soundbar HDMI connector and it has a TOSLINK input to receive optical S/PDIF digital audio stream from the TV. The same S/PDIF stream is then sent to the soundbar over the UTIL pin in HDMI connector almost as if it were a coaxial S/PDIF signal, the electrical specs are only slightly different.

So the adapter does not need to handle HDMI streams at all. However it might have a specialized chip for the ARC physical interface to meet the electrical specs of the S/PDIF signal.