I know basic nerve physiology of impulse conduction and transmission, but I don't know what actually happens in a nerve cell when a thought is generated. When a external stimulus (like tactile stimulation, injury causing tissue damage) leads to stimulation of respective Na+Channels and action potential is generated. But what is the stimulus in the neurons of the Central Nervous System when we think about something? What exactly is the stimulus that cause the neuron to generate action potential and then following it, it is transmitted to different circuits and then we react accordingly?
This is a recurring question that many people are bothered with. I read an interesting answer on Quora. Basically, the author says that there is always on-going activity in the brain. Each thought is triggered by something, let it be conscious or unconscious. The brain is never silent, even in your deepest sleep with only slow-wave synchronized activity, there is still activity. Even when it seems that a certain thought pops up totally randomly, it is still triggered by certain inputs, let they be sensory or internal. Note that action potentials can be triggered either by signals from the outside world (sensory receptor neurons), or by signals from other cells in the brain and body.
Also note that most, if not all neurons show background activity ('neuronal noise'); they never stop firing even without inputs. When one or more of those background potentials impinge on a postsynaptic neuron, that neuron may be activated an fire an action potential. This may also explain some random events in the nervous system.