Consciousness occurs when:
(1) The model we learn of the environment, extends to our own bodies status indicators, then our general emotional mood/emotions/reflexes, and finally to some level awareness of our thought behaviors. So our general model includes some visibility and modeling of our own thinking processes.
(2) Our control where we learn to redirect the environment, extends to our bodies as subjects themselves, not just as means to control the environment, then the ability to exert influence on our internal body state (note: control does not mean direct. I can't just turn off stress, but I can go for a walk.) And then to our moods, emotions, and mental reflexes (again, direct isn't necessary, just some means of influencing), and then to some level or our internals thoughts. So our general control map lets us exert some control and influence over our own thinking processes.
(3) Given the tight awareness of some internal through processes, with some control of those thought processes, with similar tight pairing of mood/emotion/mental-reflex awareness and influence, internal body state awareness and influence, external body state awareness and influence, and environment with some level awareness and means of influence ... the most central point of this convergence, thought process awareness and influence, can essentially converge these activities into one inextricable module.
This means that the "watcher" and the "do-er" are not separable (at least on the balance: of course this is not complete. We can be aware of somethings we can't influence, we can influence some things we are not directly aware of).
That this merge of awareness, modeling the subject of awareness, means control, exerting influence, on our own thoughts with our own thoughts in realtime, we have consciousness.
This happens because as we are able to model and strategically influence more sophisticated things, the survival value in being able to do that with our own mind goes up significantly.
So we have a causal path and purpose for consciousness.
It isn't some strange accidentally acquired ability. It is a direct and effective survival strategy.
But that is only one theory. Quantum consciousness fields, Egyptian pyramids, Aliens, a super consciousness that fills the universe, Atlantis, an Apple, a strict "Not a Chinese Room" physics law, or a non-testable, non-identifiable, non-detectable realm (dark cognition?) could be handing out consciousness to people like candy. Or we could all be automatons, who think we are conscious, and wasting a lot of time talking about "it".
Only time will tell if the functional, survival based reason for model-of-self, influence-on-self, integration as one thing is a plausible scenario.
Not that the theory described above has testable assumptions.
Can the minds model of itself be separated from its ability to influence itself? (We can flail sedated arms, we can feel paralyzed arms. Is that easily possible in the brain.) If they are separable are these separate networks, or are we just suppressing different kinds of cells in an otherwise highly integrated network? Not trying to be exhaustive, or even serious, about any of these proposals. Just pointing out that experiments are possible with regard to the (1) model=actor integration, (2) with evidence of survival benefits, theory of consciousness.
One strong post-prediction of mode/actor convergence as survival adaptation: Consciousness will care very much about itself. Most conscious identities will care very much about the continuity of itself, and second order means of protecting its continuity, like food and acts that sometimes produce babies as side effects. Consciousnesses will be obsessed with themselves, thinking about "themselves", i.e. the consciousness as a being, and process almost everything with some degree of conscious self-interest.
So a theory of survival generated consciousness, is also a theory of emergent personhood.