If you have a clock that shuts off when the power is cut, you don't need to worry about drifting:
Most of those are synchronized to the grid, and the grid keeps time really, really well. They actually synchronize the grid to atomic clocks etc for that purpose.
I have clocks in various mains powered devices that will drift noticeably over a couple of months. Some survive small brownouts, some don't, I have one which will last for a decent length cut.
I'd wager all of them get timing from an internal oscilator driven by a low-voltage DC supply and have no mains frequency or voltage anywhere near them.
I guess, if they survive any power cut at all, they are probably not taking their time cues from the main's frequency. I agree with your wager that they probably run on low-voltage DC and perhaps have a capacitor somewhere to bridge short outages.
Where do you live that you have frequent enough brown outs to notice these things?
I have a time switch. It looks entirely mechanical, but I suspect it gets its time signal from the mains: it doesn't seem to drift at all. If there's ever a power outage (which happens from time to time when our breaker trips, not because the real mains is down) it just stops advancing the time, but doesn't reset, because it's all mechanical.
The grid? As in power lines? How in the world would that even work? I've seen a clock that could reset its own time using radio signals. I don't think radio counts as the grid however.
Some clocks use the mains frequency as the input reference. They aren't talking about the time of day being synchronized, just time intervals. I wonder how common that is among modern appliances.