No one has really explained the mechanism of anesthesia and consciousness except for Stuart Hameroff. Amazingly, anesthesia affects all living things, including mammals, amphibians, insects, fish, worms, and protozoa.
The theory is that anesthetic effects have something to do with quantum mobility. The anesthetic effects Tubulin, which is a component of microtubules.
The theory posits that consciousness occurs in a multi-scale hierarchical resonance system originating in quantum terahertz oscillations in tubulin/microtubules inside neurons. Consciousness could be more like music than computation.
Penrose stated that conscious understanding is non-computational, and that something outside the computational system is required. This is related to quantum state reduction, collapse of the wave function, and the "measurement problem" in quantum mechanics. A factor related to the underlying structure of the universe (spacetime geometry, quantum gravity) is also involved.
Consciousness is a sequence of conscious moments or events, and memory appears to reside in microtubules.
The problem that arises is that if anesthesia blocks consciousness, why are there no out-of-body experiences under its influence?