Functional magnetic resonance imaging (fMRI) is a neuroimaging technique that measures and maps brain activity by detecting changes in blood flow. It operates on the principle that when a specific brain area is more active, it consumes more oxygen and thus requires increased blood flow to that region, allowing researchers to visualize brain functions related to cognitive processes and consciousness.