In order to understand how a windup clock works, we first have to look at how pendulum clocks work. Three hundred years ago, it was discovered that the time it takes for a pendulum to swing will remain constant, as long as the pendulum stays the same length and it keeps swinging. The key to keeping the pendulum swinging is something called an escapement. This is a mechanism powered by a gear train with a weight or spring on it. The pendulum is connected to an arm which goes in between the teeth of the escapement wheel (large gear). When the pendulum swings, a tooth on the gear becomes unlocked, moves slightly and then is locked on the arm again. This creates the ticktock sound we're so familiar with.
The escapement is also attached to gear trains that push the hands and chimes. These gear trains are attached to a pulley, and on the other side of the chain is a weight. Very slowly, these weights pull down on the gears, which turn them. When the weights get close to the end of the chain, they need to be wound back up so the process can begin again.
In windup clocks, instead of a pendulum that keeps the gears moving at a steady rate, there's an oscillating wheel. When you wind up the clock, the oscillating wheel moves a gear train, which is connected to an arm that moves the hand pieces. In windup alarm clocks, there's also a spring that has its own escapement and gear train connected to the main gears in the clock.