I can't say for sure that all electric clocks work the same way but a couple of years ago I tore into a non functioning clock and was a little surprised to find that the clock is really a mechanical clock with the main spring replaced with a solenoid. About every 20 seconds the solenoid activates and winds a little "main Spring". The clock will tick tock for about a minute if the solenoid is not tickled.
I've got one of those in my '68 Buick. Every minute or so I can hear a 'click!' as the clock winds itself.
What's also surprising to me is that the act of setting the time on these mechanical ones also adjusts the speed of the clock. If the clock is running fast then turning the hands back will cause the clock to run a few seconds slower per hour. After setting the clock a couple of times, my Buick is pretty accurate - a month later and the time is still correct, not bad for a mechanical clock.
Nowadays one can get the mechanical innards replaced with a quartz clock. Externally it looks the same, but internally it uses a quartz-crystal controlled electric motor. The result is incredible precision, no need for speed adjustment and no winding (so long as the electricity keeps flowing).