Molecular switches operate based on changes in their molecular conformation. When an external stimulus is applied, it induces a change in the molecular structure, which in turn alters its physical or chemical properties. For instance, in a light-activated molecular switch, photons can induce a change in the molecular geometry that can result in a different electronic configuration. These changes are often reversible, allowing the molecule to switch back to its original state when the stimulus is removed.