Insights into degradation and ion transport in lithium- and sodium-based battery materials using advanced scattering techniques