How do I choose what I think? Where do my thoughts come from? What allows me to choose them at all? Regardless of whether free will is an illusion or not, what makes a thought happen? (This is a mix of a philosophical question and a biological one)
First, I think you'll find that most cognitive scientists do not believe in free will. It definitely is relevant to your question, because if you believe in free will, then you basically don't believe that our thoughts have causes.

Second, you'll be interested, I think, in the idea of spreading activation. Models based on spreading activation capture the intuition that our train of thought has an associative character (I think of castles, which remind me of kings, which remind me of giant drumsticks, which remind me of chickens, etc etc.). But don't get too hung up on this model -- associationism like this can only be part of the story (often our train of thought has a much more hierarchical structure).