Usually A mechanism powered by a coiled spring and regulated by some form of escapement; the power is transmitted through toothed gearwheels and used to drive a mechanical clock, toy, or other device.
Many contrivances for making model horses move up and down as on roundabouts were patented in 1887, and toy horses pulling toy carts were made to imitate galloping by means of clockwork.1971, Gwen White, Antique Toys And Their Background, page 67:
2
Usually The action of behaving mechanically in the manner of a clock.
The mind feeds upon the body: pale sickness, and early decrepitude, overmaster even its spiritual essence. Too late it discovers that this earth is its prison, and not its home: the heart beats, and its pulses are the clockwork of wretchedness:...1837, L[etitia] E[lizabeth] L[andon], “An Evening Alone”, in Ethel Churchill: Or, The Two Brides. […], volume I, London: Henry Colburn, […], →OCLC, page 307:
In their freight, as in their passenger operations, the N.S. present a picture of clockwork efficiency.1962 April, J. M. Tolson, “The Nederlands Railways today: III: Signalling and freight”, in Modern Railways, page 244: