Thoughts come from our brains, to state the obvious. The brain is a bit of a mystery. Thoughts are likely influenced by the input of information to the brain, feelings at the time, and perhaps some subconscious desires.
It is true sometimes we can't control them. But remember we don't have to act on them either.
Hmm I guess our experiences, whats in our immediate environment. Yeah it never stops!