Process by which ion channels open and close their pores. Some, such as voltage-gated ion channels, open and close depending on the electrical potential of the cell membrane. Others depend on such factors as cell volume, intracellular metabolic state (ATP concentration, etc), intracellular ligand and/or second messenger presence (Calcium, cyclic AMP due to light, etc), and extracellular ligands (neurotransmitters like acetylcholine, GABA). It always involves a change in the shape of the protein (called "allosterism").