This question originally appeared on Quora. Answer by Paul King, computational neuroscientist, data scientist, and software entrepreneur.
This is very much a topic of ongoing research, and while some clues have started to emerge, the big picture of how the brain does this has not yet been worked out.
Some people, particularly in philosophy, are not convinced that the brain does create consciousness, although in the field of neuroscience, this is the generally accepted belief.
Piecing together the currently popular theories suggests the following general picture for how the brain creates consciousness, proceeding from the neuron to society:
Neural circuits organize statistical input and output: The brain is processing sensory input and generating motor output on a continual basis, functioning basically as a statistical information processing and prediction machine.
Memory constructs a dynamic model of the world: One aspect of how the brain works is that it generates an interactive dynamic model of the world based on the statistical information received from the senses. This model includes an understanding of the environment, a representation of the physical body itself (body image; the way you know your hand is yours and not somebody else's), a representation of other beings in the social world (parents, friends, society, animals), and ultimately a representation of oneself. The representation of oneself may be an extension of social modeling reflected back onto oneself (the purported owner of one's perceptual experiences); it may also be the "actor" responsible for the observed behavior represented by the body image (perception of "agency").
Information integration unifies coherent perception: One aspect of the "conscious field" is that it appears unified, complete, coherent, and self-aware, even though experiments show it is not. This may be made possible by extensive feedback pathways within the brain, which exchange information between brain areas, unify perception into a single coherent point of view, and drive the brain's representation of the body's identity toward a consistent model of goal-directed voluntary action.
Episodic memory creates identity through personal narrative: In humans in particular, "one-shot memory" is able to store an episodic record of the events we experience along with causal models and explanations. This "episodic memory" is organized into a multi-layer narrative on many time scales. Our knowledge of our own personal history forms our identity of who we are, which further supports our understanding of that entity, which is being aware, experiencing perceptions, and causing actions — our "self."
Social structure reinforces a model of reality and agency: Society and human culture further reinforce this "mutually developed" model of who we are, who other people are, who they think we are, what we think they think of us, etc. There are many levels of recurrent nesting of representations of our personal and social identities, both within our own brain and distributed across the brains of our family, community, and social relations.
Language codifies social reality and supports transmission of cultural beliefs: All of this is brought into a crisp structured social-conceptual framework using language. Language is a culturally-transmitted conceptual system with a spontaneously developed sequential coding scheme (words and grammar). Language allows society to operate within a common belief system that is kept synchronized across individuals. This belief system includes concepts such as personal responsibility, intentional action, truth, knowledge, and other core belief frameworks that provide a foundation to our conscious experience.
Thus the brain plays a role in generating and maintaining a model of the world that includes "us," and also includes "us" believing we are having self-aware experiences. In modern human society, this is further supported by a shared reality and belief system that we acquire from infancy through cultural transmission, human language, episodic memory, and personal identity.
by Quora For Medical Daily