Ion-Exchange Mechanism of Layered Transition-Metal Oxides: Case Study of LiNi<sub>0.5</sub>Mn<sub>0.5</sub>O<sub>2</sub>