Solid-state NMR has its unique advantages over other techniques in investigating functional light elements (e.g., Li, Na, H, O). In particular, in situ NMR is capable of catching transient processes. In situ 7Li NMR was employed to monitor the intercalation and de-intercalation of Li in important rechargeable battery systems and to help illustrate the effects of ion migration on the bulk and surface structures. The new in situ NMR probehead design provides convenient connections to battery electrodes, cancellation of noise pickup, and a variable temperature range of -50-100oC, which is helpful to evaluate the temperature-dependence of the battery performance. Ex situ 17O MAS NMR experiments have also been employed for the first time to directly probe O migration and loss over extended cycling. Chemical surface modifications, bulk composition variation, and new synthesis methods have been applied to improve battery performance.