Molecular switches are molecules that can reversibly shift between different states in response to external stimuli such as light, electrical signals, or chemical changes. These molecular devices are fundamental in the field of nanotechnology because they offer a way to control and manipulate systems at the nanoscale.