We have some knowledge of the world and how consciousness fits into it: brain activity is the key. There are as yet only theories as to the connection between brain activity and consciousness, the explanation will become clear when we understand enough about how the brain works.