Qualia are generated by the neural firings in the brain. At present, the principle behind this remarkable aspect of nature is not known.
Mogi, K. (1999) Response Selectivity, Neuron Doctrine, and Mach's Principle. in Riegler, A. & Peschl, M. (eds.) Understanding Representation in the Cognitive Sciences. New York: Plenum Press. 127-134.