Insights In Structure-Diffusion Relationships In Photovoltaic And Battery Materials From Ab Initio Calculations And Machine Learning Potentials