An EEG (Electroencephalogram) machine detects and records the brain's electrical activity using electrodes placed on the scalp, creating brainwave patterns (alpha, beta, theta, delta) to diagnose issues like epilepsy, sleep disorders, coma, or brain death, offering high temporal resolution but lower spatial detail than MRI/CT, and is crucial in neurology, psychology, and neuroscience research.