The cable
A Thunderbolt cable has room for the whole picture. Each frame of a 24‑inch iMac’s screen is about 17 MB, and 60 of them a second need about 8 Gbit/s: more than Wi‑Fi or an ordinary Ethernet network carries. Look for the ⚡︎ symbol on the plug.
USB‑C charging cables look the same but can’t carry the lossless picture. With such a cable the picture can still continue over the cable’s USB link, compressed. A USB‑C cable without Thunderbolt
The ports
Use a port with the ⚡︎ symbol on both Macs. Not every USB‑C port has Thunderbolt, so look for the symbol next to the port.
How you can tell it works
Setup says “Thunderbolt cable detected”, and the menu shows the display as “Thunderbolt · Highest quality”. Highest, the lossless level, is only available over Thunderbolt.
