I think everything tends to spring organically from basic problem solving. One has a piano to play, so one starts composing for piano. One has a musical friend and asks to bounce composing ideas off of them and they think it would be fun for you to write a duet they could play with you. If they are a better performer than you, you take the opportunity to write them a more technically difficult part than you have been composing for yourself. They have a concert coming up in the spring that's going to be a _____ concert. "Write me something that will work with that style," they say, "and I'll pitch it to the rest of the group." Given the time pressure, you opt to write a slow piece, since that means fewer notes to get on the page to fill the needed playing time, and to work with a form that has a repeat built into it for the same reason. Several weeks of very late nights later, you are heartily sick of this piece, so when it's finished you start work on something that is its polar opposite: different instruments, fast tempo, and since you are now worried that your last one was perhaps too simple, this one is filigreed up to the hilt.
Every step along the way is a reaction to circumstance.