Consciousness is a trick for human neural network to simplify some calculations about the world. It was developed as an evolutionary trait and proved useful to survive. That's my opinion. It's not an illusion, it definitely exists as an particular configuration of neurons.