This document discusses how a brain-computer interface (BCI) works. It explains that a BCI detects sensorimotor rhythms in the mu and beta frequency bands in the sensorimotor cortex using EEG or ECoG. It describes how motor imagery causes event-related desynchronization and synchronization of these rhythms. A BCI also requires training users to generate distinguishable brain patterns through motor imagery without external stimuli. Signal processing techniques are used to extract relevant features and classify patterns for device control.