Very interesting this topic.
For a long time, my compositional processes were simply learning, and I consider them just exercises. Of course, from time to time there was an idea that I found valuable.
Already at another stage, with more resources, to my credit... I still continue to do many things as examples and exercises, because my amateur pedagogical vocation is very strong.
But when I start writing music by itself, both things happen to me. Sometimes I am absorbed in the music itself, in how to develop ideas, textures, combinations, harmonies and etc... But other times I am moved by emotions that I want, in some way, to express. The truth is that it has, in my opinion, quite a bit of technique. The more you know, the more repertoire of compositional resources you have, the better you can express an emotion.