If you say that an idea, emotion, or other factor is the mainspring of something, you mean that it is the most important reason or motive for that thing. [written]
My life has been music, and a constant search for it has been the mainspring of my life.
You begin to understand what actions were the mainspring of the story.
Synonyms: cause, inspiration, motivation, source