I am not an expert, but I do have some ideas on the subject. There is an entire branch of psychology that implies consciousness is a by-product of the human (physical) mind.
I don't happen to subscribe to this belief. In my opinion, the first truth (and the only one that you can reliably believe in) is consciousness itself. That is to say, you are having an experience, and that is all that you can rely upon.
Am I the only conscious being in existence, and everything else is a projection of my consciousness?
If there is a macrocosm (some part of the universe separate from myself), what is its nature?
I suppose we can think of all kinds of variants of these questions, but here's what I believe:
The first principle is soul (consciousness is a soul trait). We have been conditioned to the human experience so we believe only humans are aware. In reality, our soul has been stuffed into an uncomfortable, human-shaped sock that limits our mental / physical/ emotional range of conscious experience. But consciousness itself is so much more.
(these are my opinions, and yes they were taught to me as well as being somewhat self-evident)
Spirit, soul, is a unit of awareness. It is present in everything, from rocks to plants to trees and, yeah, molecules of air. So in that sense cells dividing and heart pumping are a function of consciousness. Whose consciousness? Well, if you believe as I do, there are governing forces (not human) that take care of these autonomic functions. Humans are just one aspect of creation, one that we happen to be experiencing right now. But soul is eternal, and we have gone through many different types of being. I believe all of the macrocosm is composed of spirit, vibrating at different frequencies, taking form when it is vibrating slowly enough to coalesce into coarse things like thought or emotions, or slower and coarser yet--physical matter. I believe that when freed from manifestation, in its pure form spirit (soul) experiences a much, much, much higher awareness, so much so that it is qualitatively different than our current human experience.
Eastern traditions give the governing forces of the body names, like Ganesh etc. Rather than delve into all the metaphysical stuff, I'll just end on this note: consciousness is so much more than our current human experience, and the journey of self-discovery is the next step in this never-ending adventure that soul is undertaking.
EDIT: I'm not sure what the ultimate function of consciousness is, but at this current stage humans are having the experience they are having to purify and refine our awareness, to teach us simple things like cause and effect, personal responsibility, and the nature of love and truth.