Let's take an admittedly speculative dive into how consciousness might arise. This is intended as an example of how it might happen. I am not claiming this is how it actually does happen. We start by reminding ourselves what we mean by "aware". A is "aware" of B if A encodes information about B, such as its presence, in a way that includes electromagnetic fields, which would mean potential mindness. In the case of our central nervous system, that will often include responding to B by encoding some sort of internal representation of B in neuronal activity.
Sensory inputs to cortical neurons cause them to change their ongoing activity, thereby changing their associated electromagnetic fields, (EMFs). The changing EMF, feeds back on those originating cortical cells, further modifying the behavior of those cells, which of course, further modifies the EMF those cells produce. In other words, the EMF feeds back on its source, changing the source's behavior, which then changes the EMF. That means the EMF is responding to the initial stimulus as well as itself, which, in our model, suggests it is aware of itself, what it is doing. One possible issue with this explanation is that it merely predicts an automatic drop in magnetic flux rather than a more robust change in the EMF configuration. That's a problem because a drop in magnetic flux might also be caused by a stimulus changing intensity. So a stimulus with varying intensity automatically becomes conscious.
An alternative path to consciousness depends on lateral inhibition and a second set of neurons. An excited cortical column would increase its associated EMF. Very soon afterword, lateral inhibition spreading outward from the excited column would decrease the activity in neighboring columns, decreasing their associated EMFs. That means the central EMF region would show an initial increased flux and that would be registered by a surrounding decrease in magnetic flux. This decrease in flux constitutes a detection (an awareness) of the centrally located excitation (unconscious awareness). Awareness of awareness is our working definition of consciousness. Thus, we become conscious of the excited cortical region. Neurons may not be the only material actors contributing to this drama. There are, for one example, more neuroglia cells in the brain, than neurons.