It turns out the key is a bimetallic strip. At a certain, carefully adjusted temperature, the bimetallic strip will bend just enough such that right when the water starts to boil, the bent strip will trigger the mechanism that flips the switch to the OFF position.
It doesn’t matter how much water is in the pot. Once the water is boiling, the temperature in the base will be at a certain point. That temperature point is the trigger threshold for the bimetallic strip. More or less.
That sounds complicated, but watch the video. It’s pretty simple!