1590s, "principal spring of a mechanism" (of a watch, clock, gun, etc.), from main (adj.) + spring (n.3). Figurative meaning "impelling cause or motive of any action" is from 1690s.
Entries linking to mainspring
main adj.
early 13c., "notably large, bulky, or strong" (a sense now obsolete), from Old English mægen- "power, strength, force," used in compounds (such as mægensibb "great love," mægenbyrðen "heavy burden;" see main (n.)), probably also in part from or influenced by cognate Old Norse megenn (adj.) "strong, powerful, mighty."
Sense of "chief, principal, prime" is from c. 1400. That of "principal or chief in size or extent" is from 1590s. Main chance "opportunity of enriching oneself" is by 1570s, from the game of hazard. Main course in the meal sense attested from 1829. Main man "favorite male friend; hero" is by 1967, African-American vernacular.
spring n.3
"act of springing or leaping," late 14c., from spring (v.). The elastic wire coil that returns to its shape when stretched is so called from early 15c., originally in clocks and watches. As a device in carriages, coaches, etc., it is attested from 1660s.