Your thoughts move along a line, a "train of thought," until they hit a barrier.
At this moment you are probably unconscious as the line bends, changing what you are thinking, and sometimes even completely, when you lose your train of thought.