The utility can signal this by varying the price from minute to minute. The heater can retrieve this signal from the internet.
If the electricity is down, the. Internet will be down, and without this feedback mechanism working they wouldn't be able to keep the grid stable.
Nest (and I assume other internet-connected) thermostats are able to accept peak-usage notifications from the power company and dynamically reduce usage. In my case (Portland Electric), it's two-way communications, if Nest can prove to the power company that I let its device reduce usage during peak-load times, I get a credit at the end of the year. The Nest in my house has almost paid for itself.