An automatic mechanical watch contains a semicircular ‘rotor’. The rotor is a weight that pivots inside the watch case.
Normal arm and wrist movements cause the rotor to pivot back-and-forth on its staff, which is attached to a ratcheted winding mechanism. The circular motion of the rotor moves a series of gears that then wind the mainspring.
Modern automatic watch mechanisms have two ratchets so that the mainspring winds during both clockwise and counterclockwise rotor motion.
A typical watch’s fully-wound mainspring can store enough energy to run for around two days without being worn. This allows automatic watches to keep running through the night while not being worn. In many cases automatic watches can also be wound manually by turning the crown, so the watch can be kept running when not worn, or in case the wearer’s wrist motions are not sufficient to keep it wound automatically.