From what I've read, the card detects if it has been continuously mining for 30 minutes then throttles itself.
That said, Anandtech wrote about it briefly recently:
https://www.anandtech.com/show/16648/nvidia-updates-geforce-...
They surmise that there is hardware-enforcement of BIOS\Drivers via some blown eFuses.
Also they imply that nVidia does multiple checks such as whether it's running on a PCIe x1 bus (gamers would typically use x4 or more) and whether it's hooked up to a monitor. It's likely they check for other things too but they would keep it on the down-low.
I'm curious about how this is implemented.
I'm also somewhat skeptical about GPU makers doing this for compute in general.