Thoughts come from nowhere and from everywhere! Both - both contain an element of truth.
Subjectively, our thoughts come from nowhere: they just pop into our heads or emerge in the form of words leaving our mouths.
Objectively, we can say that thoughts emerge from neural processes and that neural processes come from everywhere.
What one means by this is that the forms and dynamics of thought are influenced by everything that has a causal connection with you, your society, and your species.
There is plenty of indirect evidence to support the general claim that the brain is where thoughts emerge. The neuronal patterns that mediate and enable thought and behavior have proximal and distal causes.
The proximal causes are the stimuli and circumstances we experience. These experiences have causal impacts on our bodies and are also partly caused by our bodies.
The forces inside and outside the body become manifest in the brain as "clouds" of information. In the right circumstances, these nebulous patterns can condense into streams of thought.
We can add to these identifiable causes the mysterious element of randomness: that seemingly ever-present "ghost in the machine" that makes complex processes such as life fundamentally unpredictable. Perhaps randomness is what provides the "seeds" around which the condensation of thoughts can occur.
The distal causes are our experiential history and our evolutionary pre-history.
Our experiential history consists of the things we've learned, consciously and unconsciously, and the various events that have shaped our bodies and our neural connections in large and small ways.
Our evolutionary pre-history is essentially the experiential history of our species, and more generally of life itself, going back all the way to the first single-celled organism. The traits of a species are a sort of historical record of successes and failures. And going even further, life ultimately takes its particular forms because of the possibilities inherent in matter, and this takes us all the way to the formation of stars and planets.
As it’s a large area- let us see the main points
Thought (or thinking) can be described as all of the following:
• An activity taking place in a brain and mind – abstract entity with the cognitive faculties of consciousness, perception, thinking, judgement, and memory. ; computer.
• An activity of intelligence – intelligence is the intellectual prowess of which is marked by cognition, motivation, and self-awareness.[3]
• A type of mental process – something that individuals can do with their minds.
• Thought as a biological adaptation mechanism[4]
• "Outline of a theory of thought-processes and thinking machines" (Caianiello)[5] – thought processes and mental phenomena modeled by sets of mathematical equations
• Surfaces and Essences: Analogy as the Fuel and Fire of Thinking (Hofstadter and Sander)[6] – a theory built on analogies
• The Neural Theory of Language and Thought (Feldman and Lakoff)[7] – neural modeling of language and spatial relations
• Thought Forms – The Structure, Power, and Limitations of Thought (Baum)[8] – a theory built on mental models
• Unconscious Thought Theory[9][10] – thought that is not conscious
• Linguistics theories – The Stuff of Thought (Steven Pinker, Noam Chomsky)[11] – The linguistic and cognitive theory that thought is based on syntactic and linguistic recursion processes
• Language of thought hypothesis (Jerry Fodor)[12] - A syntactic composition of representations of mental states - Literally, the 'Language of Thought'.
What is most thought-provoking in these thought-provoking times, is that we are still not thinking.
— Martin Heidegger[13]
Martin Heidegger's phenomenological analyses of the existential structure of man in Being and Time cast new light on the issue of thinking, unsettling traditional cognitive or rational interpretations of man which affect the way we understand thought.
Phenomenology,
however, is not the only approach to thinking in modern Western philosophy.
Philosophy of mind is a branch of philosophy that studies the nature of the mind, mental events, mental functions, mental properties, consciousness and their relationship to the physical body, particularly the brain.
The mind-body problem, i.e. the relationship of the mind to the body, is commonly seen as the central issue in philosophy of mind, although there are other issues concerning the nature of the mind that do not involve its relation to the physical body.[15]
Human perceptual experiences depend on stimuli which arrive at one's various sensory organs from the external world and these stimuli cause changes in one's mental state, ultimately causing one to feel a sensation, which may be pleasant or unpleasant.
Someone's desire for a slice of pizza, for example, will tend to cause that person to move his or her body in a specific manner and in a specific direction to obtain what he or she wants.
The question, then, is how it can be possible for conscious experiences to arise out of a lump of gray matter endowed with nothing but electrochemical properties.
A related problem is to explain how someone's propositional attitudes (e.g. beliefs and desires) can cause that individual's neurons to fire and his muscles to contract in exactly the correct manner.
Functionalism vs. embodiment-
This approach states that the classical approach of separating the mind and analysing its processes is misguided: instead, we should see that the mind, actions of an embodied agent, and the environment it perceives and envisions, are all parts of a whole which determine each other.
Therefore, functional analysis of the mind alone will always leave us with a mind-body problem which cannot be solved.[19]
Biology-
Neurons are the core components of the brain, the vertebrate spinal cord, the invertebrate ventral nerve cord, and the peripheral nerves.
A number of specialized types of neurons exist: sensory neurons respond to touch, sound, light and numerous other stimuli affecting cells of the sensory organs that then send signals to the spinal cord and brain. Motor neurons receive signals from the brain and spinal cord that cause muscle contractions and affect glands.
Interneurons connect neurons to other neurons within the brain and spinal cord.
Neurons respond to stimuli and communicate the presence of stimuli to the central nervous system, which processes that information and sends responses to other parts of the body for action.
Psychology-
In recent years, the Piagetian conception of thought was integrated with information processing conceptions.
Thus, a thought is considered as the result of mechanisms that are responsible for the representation and processing of information.
In this conception, the speed of processing, cognitive control, and working memory are the main functions underlying thought.
In the neo-Piagetian theories of cognitive development, the development of thought is considered to come from increasing speed of processing, enhanced cognitive control, and increasing working memory
For psychoanalysis, the unconscious does not include all that is not conscious, rather only what is actively repressed from conscious thought or what the person is averse to knowing consciously.
In a sense this view places the self in relationship to their unconscious as an adversary, warring with itself to keep what is unconscious hidden. If a person feels pain, all he can think of is alleviating the pain. Any of his desires, to get rid of pain or enjoy something, command the mind what to do. For Freud, the unconscious was a repository for socially unacceptable ideas, wishes or desires, traumatic memories, and painful emotions put out of mind by the mechanism of psychological repression.
The collective unconscious, sometimes known as collective subconscious, is a term of analytical psychology, coined by Carl Jung. It is a part of the unconscious mind, shared by a society, a people, or all humanity, in an interconnected system that is the product of all common experiences and contains such concepts as science, religion, and morality.
While Freud did not distinguish between an "individual psychology" and a "collective psychology", Jung distinguished the collective unconscious from the personal subconscious particular to each human being. The collective unconscious is also known as "a reservoir of the experiences of our species".[30]
I think with a brief on the origin of thought, its nature and holistic connected regions-the origin may be visualized.
Ref.-
https://en.wikipedia.org/wiki/Thought
https://www.forbes.com/sites/quora/2016/10/21/where-do-our-thoughts-come-from/#61cd0d3d2ee2